More in this section

Forums / Developing with Sitefinity / Applying the 1st node of the sitemap to a label

Applying the 1st node of the sitemap to a label

2 posts, 0 answered
  1. UI Crew
    UI Crew avatar
    151 posts
    Registered:
    27 Sep 2012
    01 Apr 2008
    Link to this post
    Hi all,

    I am currently working on a project where the menu name attribute of certain levels (levels 1 and 2) of the sitemap need to be applied  to a asp:label in the page template for the current page.

    Does anyone know how to achieve this?

    If you have a look at the HTML of the concept designs here the sub navigation panelbar in the page starts at level 3 of the site structure and the "QR Finance" in the design is the first level of the current tree in the sitemap and the "Property" h2 above the panel is the second level.

    I was able to do the breadcrumbs in the design very easily with Sitefinity however I would appreciate if anyone has some coding pointers to help me get the menu name and url from the first and second level of the sitemap for the current page and apply it to some labels.

    Cheers,

    Seth
  2. Pepi
    Pepi avatar
    981 posts
    Registered:
    31 Jan 2017
    02 Apr 2008
    Link to this post
    Hello Seth,

    I would recommend you create your own custom control that extends the ASP.NET SiteMapPath control. Actually, Sitefinity Breadcrumb inherits SiteMapPath and overrides certain methods to make it resolve absolute paths. Here are some useful online resources:

    1. SiteMapPath class
       Please, note that SiteMapPath has a property called ParentLevelsDisplayed. It gets or sets the number of levels of parent nodes the control displays, relative to the currently displayed node.
    2. SiteMap class
       Its CurrentNode property gets the SiteMapNode control that represents the currently requested page.

    Hope this helps.

    Greetings,
    Pepi
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
2 posts, 0 answered