Custom Navigation

Posted by Community Admin on 04-Aug-2018 05:12

Custom Navigation

All Replies

Posted by Community Admin on 12-Oct-2011 00:00

Hi all,

Here is a code sample that I am trying to convert to use the configuration from the navigation page.  The code is written in such a way to only use the Top Level pages.  I want it to pick up the "All Pages Under Particular Page" and "Custom selection of Pages"  How do I modify the code below to do this?

<%@ Control Language="C#" AutoEventWireup="true" %>
<telerik:RadTabStrip ID="RadPanelpageNav" runat="server" Visible="false" />
 
<asp:Repeater  ID="Repeater1" runat="server" DataSourceID="SiteMapDataSource" >
    <HeaderTemplate>
        <ul class="page-nav-holder">
    </HeaderTemplate>
    <ItemTemplate>
            <li>
                <a href='<%# Eval("Url") %>' runat='server'>
                    <h3><%# Eval("Title") %></h3>
                    <p><%# Eval("Description") %></p>
                </a>
            </li>
    </ItemTemplate>
    <FooterTemplate>
        </ul>
    </FooterTemplate>
</asp:Repeater>
 
<asp:SiteMapDataSource runat="server" ID="SiteMapDataSource" StartingNodeOffset="0" ShowStartingNode="false" />

Posted by Community Admin on 14-Oct-2011 00:00

You could use a RadPanelBar?

Posted by Community Admin on 14-Oct-2011 00:00

Probably, not sure that is the real problem.  I think the real issue lies around <DataSourceID="SiteMapDataSource">

I want to get the information from the configuration, not the SiteMap.

I am new with this and may be way off base.

Thanks.

Posted by Community Admin on 21-Oct-2011 00:00

Where can I find more information on creating custom navigation controls?  This thread has been here for a while and I am not getting any "real" answers.  Thanks to the other users, but can I get some input from a Telerik resources? 

Next questions.

Is there Navigation.Manager object?
Is that how I get to the navigation configuration data?

I downloaded the SDK, but it says it isn't licensed.  How do I get a license.  It won't extract the examples.

Posted by Community Admin on 24-Oct-2011 00:00

Hi Tom Miller,

You can bind any of the suitable RadContorls - TreeView, PanelBar, TabStrip, Menu etc (ones that support hierarchical data representation) to our SitefinitySiteMapDataSource control, which is responsible for handling all the necessary logic cocerning pages that are marked as ShowInNavigation = false, page permissions, group pages etc. The control can be configured to output the whole frontend sitemap, but also supports standard SiteMapDataSource features like StartingNodeOffset, StartFromCurrentNode, StartingNodeUrl etc. If none of the above functionality suits you you can easily create you own datasource to bind your control to by using our Pages API.

Please find below a sample tree navigation using the above mentioned SitefinitySiteMapDataSource and RadTreeView:

<%@ Register Assembly="Telerik.Sitefinity" Namespace="Telerik.Sitefinity.Web.UI.NavigationControls" TagPrefix="sfMap" %>
<sfMap:SitefinitySiteMapDataSource runat="server" ID="SitefinitySiteMapDS"  ShowStartingNode="false" />
<telerik:RadTreeView runat="server" ID="RTV1" DataSourceID="SitefinitySiteMapDS"></telerik:RadTreeView>
If you have any additional questions, please let us know, we'll be glad to help.

Kind regards,
Boyan Barnev
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

Posted by Community Admin on 10-Nov-2011 00:00

Tom - 

Check out the CleanNav control in the marketplace. It's free and you can configure it to list pages below the currently opened page, or a selected page.

Thanks,

Chris

Posted by Community Admin on 13-Mar-2012 00:00

Tom has a very specific question here that has not been answered.

When building a custom navigation template, how does one use the configuration options set in the control designer?

Above the field where a custom template path can be set, there are several options:

Fine tune the selected type


"All pages under particular page"
When using this code (found on a different form)

<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="HomepageDropdown.ascx.cs" Inherits="SitefinityWebApp.NavigationTemplates.HomepageDropdown" %>
 
<div style="clear:both">
<telerik:RadTabStrip ID="RadPanelbarNav" runat="server" Visible="false" /> 
<telerik:RadTreeView runat="server" ID="RTV1" DataSourceID="SiteMapDataSource"></telerik:RadTreeView>
<asp:SiteMapDataSource runat="server" ID="SiteMapDataSource" StartingNodeOffset="0" ShowStartingNode="false" />
<asp:Repeater  ID="Repeater1" runat="server" DataSourceID="SiteMapDataSource" >
    <HeaderTemplate>
        <ul class="nav-holder">
    </HeaderTemplate>
    <ItemTemplate>
            <li>
                <a id="A1" href='<%# Eval("Url") %>' runat='server'>
                    <%#Eval ("Title") %>
                </a>
            </li>
    </ItemTemplate>
    <FooterTemplate>
        </ul>
    </FooterTemplate>
</asp:Repeater>
</div>


The options set in the control designer are ignored, because the repeater data source is an <asp:SiteMapDataSource> and not related to those configuration options.


As Tom asked, I'm now asking:
Is there Navigation.Manager object?
Is that how I get to the navigation configuration data? 

This information is not available in your online documentation or in the downloaded SDK.  Please advise.

thanks,
-trevor

Posted by Community Admin on 13-Mar-2012 00:00

Hi Trevor,


Please note that a template in the real sense of it is just the presentation part of the control, in other words a template which contains a control able to represent data and a datasource control is actually a complete widget, and selecting it as a template to any control would do not much than save you a couple of minutes registering it as a standalone widget, as it will actually override the control datasource with its own declaratively added SiteMapDataSource. If you want to create a template for the Sitefinity navigation widget you can simply declare any control capable of displaying hierarchical data on an ascx file and then specify it in the Design options of the Navigation widget - then the datasource will be determined by the settings you perform in the navigation widget designer and will be displayed by the control you've added to the template. By default we're using SitefinitySiteMapDataSource control in our Navigation widgets which differs from the ASP.NET SiteMapDataSource in many aspects regarding Sitefinity page permissions, group page behavior etc, so I'd recommend you use that control instead if you'll be developing custom Nav controls.

Kind regards,
Boyan Barnev
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

This thread is closed