umbracoUrlAlias would work and be dynamic if you created an event handler on BeforePublish for the documenttype to update the umbracoUrlAlias property to concat the nodeid + nodename.
using umbracoUrlAlias is fine, but in addition, you'll need an eventhandler, listing for create/update/publish event to make sure it's updated accordingly. Not that hard at all, and some pretty good examples of event handlers can be found on the wiki
Basically, all you need is a class that inherits from ApplicationBase, register for events in the class constructor and handle the businesslogic in those handlers
Also, Richard has a nice blog post on how to register and use event handlers.
Alter node url from name to id
How can I alter the url of a page to the node id or a combination of id and name (like here in the forum).
Should I use umbracoUrlAlias for that? I want it to be dynamic so if I change the node name, the url should change also.
Timsn,
umbracoUrlAlias would work and be dynamic if you created an event handler on BeforePublish for the documenttype to update the umbracoUrlAlias property to concat the nodeid + nodename.
Here some more info: http://umbraco.org/documentation/books/api-cheatsheet/attaching-document-eventhandlers
-Chris
Hi,
using umbracoUrlAlias is fine, but in addition, you'll need an eventhandler, listing for create/update/publish event to make sure it's updated accordingly. Not that hard at all, and some pretty good examples of event handlers can be found on the wiki
Basically, all you need is a class that inherits from ApplicationBase, register for events in the class constructor and handle the businesslogic in those handlers
Also, Richard has a nice blog post on how to register and use event handlers.
Hope this helps.
Regards,
/Dirk
Thanks you two, that's perfect.
is working on a reply...