Try our conversational search powered by Generative AI!

startPageLinkProperty for sitemap provider

Vote:
 

Is there something smarter/better than startPageLinkProperty in CMS5 since it seems to be removed?

In this page 4.x there seems to be a possibility to change the sitemap startPageLink with a dynamic property depending on where on the site the user is at the moment. http://www.episerver.com/templates/PageWithRightListing.aspx?id=7558&epslanguage=EN 

What I'm trying to do is to create a breadcrumb using the sitemap provider, the breadcrumb should start at different nodes depending on which part of the site the user is browsing.

#21558
Jul 01, 2008 14:52
Vote:
 

Hi!

The EPiServer Site Map Provider class is added to web.config and there is a parameter for the startpage that you can hard code to a page id. If it is not set it will use the start page as defined in siteSettings in web.config.

Enter the following section directly below (inside) the configuration/system.web node in Web.config. 

    <siteMap enabled="true">
      <providers>
        <add name="KnowledgeSiteMap" type="EPiServer.PageSiteMapProvider, EPiServer" startPageLink="3" />
      </providers>
    </siteMap>

This is an example of how you can create a breadcrumb:

<div id="BreadCrumbsMenu">
    <asp:SiteMapPath SiteMapProvider="KnowledgeSiteMap" SkipLinkText="" ID="SiteMapPathCtrl" runat="server">
        <RootNodeTemplate>
            <a href='<%# ((EPiServer.PageSiteMapNode)Container.SiteMapNode).CurrentPage["PageLinkURL"] %>'>Start</a>
        </RootNodeTemplate>
        <PathSeparatorTemplate>
            /
        </PathSeparatorTemplate>
    </asp:SiteMapPath>
</div>

Another way to consume it is the SitemapDataSource.

/Fredrik

#22066
Edited, Jul 22, 2008 11:43
Vote:
 

Hi and thank you for your reply, but it's not exactly what i was looking for, what I wanted to do is to set the "root node" with a dynamic property so the breadcrumb can have different root nodes depending on where on the site the user is at the moment...

For example if the user is under the product branch the breadcrumb starts at the product root node and if the user is under the news branch the breadcrub starts there.

In my project it worked well inheriting the asp:SiteMapPath control and add a "SkipLevels" parameter and skip the x first levels.

#22084
Jul 22, 2008 22:29
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.