Strip off parent node url in code behind
Hello,
I am needing to remove the parent node url portion from the currently loaded page in code behind and store in a variable. For example:
/parentnode/childnode
to
/childnode
I was considering using the SiteMapBase.GetActualCurrentNode() and lop off the /parentnode somehow. But then I saw the recent blog post by Stefani Tacheva www.sitefinity.com/.../custom-url-formats-for-sitefinity-hierarchical-dynamic-modules
and wondered if that might be a better direction to go in. If anyone has any suggestions I would appreciate it.
Thanks!
Scott
Hello,
Thank you for contacting Telerik Support.
I managed to acheive the result from the link you provided. I think that this approach is the correct way in handling custom url formats and this would solve your problem. Howerver, having such url-s might cause conflicts for items that have the same name and one must be carefull when using this feature.
If you have any further questions regarding this issue, please feel free to contact us again.
Hi Martin,
Any chance I can get your sample project?
Thanks,
Scott
Hello,
I am attaching the provider that I created to achieve the functionality. You will see that I have a parent type :
"Telerik.Sitefinity.DynamicTypes.Model.States.State", and a child type "Telerik.Sitefinity.DynamicTypes.Model.States.City". From there it's straightforword just registering the provider in the Advanced settings screen ( I followed the steps from Stefany's blog post and Slavo's blog post ). Note that this will affect only newly created items.