Custom Navigation with Custom Selected pages

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

Custom Navigation with Custom Selected pages

All Replies

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

I dragged and dropped navigation widget on to the master template and made custom selection of pages.(Type of navigation is "horizontal"). I pointed the customtemplatelayoutpath to the following ascx file. How can I modify the below code to inherit the datasource from control designer (custom selected pages in this case) automatically ?

<%@ Register Assembly="Telerik.Sitefinity" Namespace="Telerik.Sitefinity.Web.UI.NavigationControls"
    TagPrefix="sfMap" %>
    Company
<sfMap:SitefinitySiteMapDataSource runat="server" ID="SitefinitySiteMapDS" ShowStartingNode="false" />
<telerik:RadTabStrip ID="RadPanelbarNav" runat="server" Visible="false" />
<asp:Repeater ID="rptr" runat="server" DataSourceID="SitefinitySiteMapDS">
    <ItemTemplate>
        <a href='<%# Eval("Url") %>'>
            <span><%# Eval("Title") %></span>
        </a>
    </ItemTemplate>
    <FooterTemplate>
        </ul>
    </FooterTemplate>
</asp:Repeater>

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

I found the solution...

Replace sitemapdatasoruce with 
<navcontrols:SiteMapNavigationMenu ID="NavigationMenu" runat="server" Visible="false">
</navcontrols:SiteMapNavigationMenu>

And in the back end cs file..assing repeater.datasource = NavigationMenu.Datasource

The problem with sitefinitysitemapdatasource is it does not automatically find the custom selected pages where sitemapnavigationmenu does

This thread is closed