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

Forums / Developing with Sitefinity / Custom Navigation with Custom Selected pages

Custom Navigation with Custom Selected pages

2 posts, 1 answered
  1. Dev
    Dev avatar
    18 posts
    Registered:
    18 Jan 2013
    17 Apr 2013
    Link to this post
    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>
  2. Dev
    Dev avatar
    18 posts
    Registered:
    18 Jan 2013
    18 Apr 2013
    Link to this post
    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
    Answered
2 posts, 1 answered