Strip off parent node url in code behind

Posted by Community Admin on 04-Aug-2018 17:34

Strip off parent node url in code behind

All Replies

Posted by Community Admin on 30-Apr-2013 00:00

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



Posted by Community Admin on 03-May-2013 00:00

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.

Greetings,
Martin Gebov
the Telerik team
Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

Posted by Community Admin on 03-May-2013 00:00

Hi Martin,

Any chance I can get your sample project?

Thanks,

Scott

Posted by Community Admin on 08-May-2013 00:00

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.

All the best,
Martin Gebov
the Telerik team
Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

This thread is closed