+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / Strip off parent node url in code behind

Strip off parent node url in code behind

4 posts, 0 answered
  1. Scott MacDonald
    Scott MacDonald avatar
    29 posts
    Registered:
    08 Mar 2006
    30 Apr 2013
    Link to this post
    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 http://www.sitefinity.com/blogs/stefani-tacheva-s-blog/2013/04/29/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



  2. Martin Gebov
    Martin Gebov  avatar
    15 posts
    Registered:
    03 Nov 2016
    03 May 2013
    Link to this post
    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
  3. Scott MacDonald
    Scott MacDonald avatar
    29 posts
    Registered:
    08 Mar 2006
    03 May 2013 in reply to Martin Gebov
    Link to this post
    Hi Martin,

    Any chance I can get your sample project?

    Thanks,

    Scott
  4. Martin Gebov
    Martin Gebov  avatar
    15 posts
    Registered:
    03 Nov 2016
    08 May 2013
    Link to this post
    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
4 posts, 0 answered