Simple question really, and the custom alias plugin provides this feature but it has
some other issues with stripping special characters out of URLs thus is not an option : How do I prepend the document's ID to my URLs ?
There is no built in TVs to add as prefix and of course [~[*id*]~] won't work...
Maybe a custom TV with an @EVAL ?
CustomAlias is using the following code to retrieve the id and add it to the url :
// Get the ID of the document, if you want to use it in your alias
$id = '.'.$modx->event->params['id'];
(.........)
// Update the database
$rows_affected = $modx->db->update(
$fields,
$table,
"id = {$e->params['id']}"
);