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

Forums / Developing with Sitefinity / Modifying navigation controls

Modifying navigation controls

7 posts, 0 answered
  1. Al
    Al avatar
    33 posts
    Registered:
    28 Dec 2008
    22 Jul 2010
    Link to this post
    Hi,

    I've developed a custom skin for both the tabstrip and panel bar. They are rendering perfectly. However there are a couple of bhaviours i want to change, which I'm not sure if I can.

    The products section of the website has a structure like:

    - products.aspx
    - products/product1.aspx
    - products/product2.aspx

    If i navigate to products.aspx the panel bar shows links for both product1.aspx and product2.aspx, however if I click on either of them and go to that page, the panel bar no longer shows and links. I can understand why, because products1.aspx for example doesnt have any child pages - however the behaviour Im trying to display is that if the user is within the /products/ section, all of the child pages are always show in the navigation.

    Is this possible?

    Also, on my site I have two seperate menu's both visible at the top of the site...one for the main nav, and one for the utility nav i.e. About / Resources / Support.

    The problem is that if I create these as top level pages they appear in the main sitetabstrip. I could obviously set "Show in navigation" to false, although I still need to get these three pages to appear in the utility menu. Any suggestions?

    Regards,
    higgsy

  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    23 Jul 2010
    Link to this post
    Hello Al,

    Most probably you have set StartFromCurrentNode to True. In this case the binding starts from the current node and this is why you do not see any products pages when you go to product1.aspx. If the RadPanelBar is in your template and StartFromCurrentNode is True you should see all pages.

    SiteTabStrip control has the following properties that you can use

    ShowOnlyFirstLevel - Gets or sets a value indicating whether the RadTabStrip should show only the first level  of nodes in the sitemap - by setting this property any child tabs will not appear in the RadTabStrip control

    HideLevel - Used to specify a level in the page hierarchy, that should not be visible. The default value is -1, which indicates that all pages in the site map are shown.

    Best wishes,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. Al
    Al avatar
    33 posts
    Registered:
    28 Dec 2008
    26 Jul 2010
    Link to this post
    Hi Ivan,

    Thanks for your response. I'm not sure though how your suggestions will address my design requirements.

    How would i create a second sitetabstrip that could show my utility bar - the decision to place navigation items in either the utility bar or the main navigation is not based on the directory structure.

    If you look at www.bbc.co.uk for example, their main navigation includes Home | News | Sports | Weather etc, but they have a little menu bar above that which just has options for Mobile and Help. Thats what I'm trying to acheieve. The only way i can think of doing it is to create page properties such as:

    "Include in utility bar"
    "Include in main nav"

    And then create an .aspx control which gets the published pages and checks for this property, if it exists print out the button/link. Can you think of any other way of doing it?

    As far the RadPanelBar goes, what im trying to acheive is that if you are anywhere within the products section, the sub menu shows you all the pages that are children of the /products/ page - is this not possible?

    Thanks in advance
    higgsy
  4. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    27 Jul 2010
    Link to this post
    Hello Al,

    Thank you for getting back to us.

    What you need can be easily achieved with the built in navigation controls. For example the SiteMenu control has a property StartingNodeUrl which can be use to specify from which page to bind your menu. Thus you can choose a page which contains children pages and then the menu will bind only pages under this page. You can add the same property to the Site Panelbar - just edit the ~/Sitefinity/UserControls/Navigation35/SitePanelBar.ascx.cs:
    /// <summary>
    /// (Exposed from contained SitemapDataSource.) Gets or sets an URL
    /// of starting node that determines the root hierarchy that is
    /// exposed by the data source control.
    /// </summary>
    ///
    [WebEditor("Telerik.Cms.Web.UI.UrlEditorWrapper, Telerik.Cms")]
    [Browsable(true)]
    [Category("Navigation")]
    public string StartingNodeUrl
    {
        get
        {
            return this.SiteMapDataSource1.StartingNodeUrl;
        }
        set
        {
            this.SiteMapDataSource1.StartingNodeUrl = value;
        }
    }

    You can also configure the navigation controls to bind N levels of items. In this way you can create top level navigation which will show only nodes on level 0 of your Site map for example.

    Greetings,
    Radoslav Georgiev
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  5. Al
    Al avatar
    33 posts
    Registered:
    28 Dec 2008
    27 Jul 2010
    Link to this post
    Hi Radoslav,

    Thanks for your response - I've worked with other CMS products before and your support is to be admired!

    Before I go down this coding path, can I just confirm:

    SitePanelBar - you are suggesting I edit the template so that it always looks for the top level node i.e. /products/ and then displays the child pages of that node.

    Im not sure what you are suggesting for the two different navigation controls I need for the top level navigation. I essentially have the following structure:

    - Home (to be shown in main navigation)
        - Products (to be shown in main navigation)
        - Services (to be shown in main navigation)
        - Solutions (to be shown in main navigation)
        - Contact (to be shown in main navigation)
        - About (to be shown in seperate utility navigation)
        - Resources (to be shown in seperate utility navigation)

    I'm not sure I understand how you are suggesting I can display Home, Products, Services, Solutions and Contacts on one menu, and then About and Resources on a seperate menu. Could you elaborate please?

    Kind regards,
    higgsy

  6. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    27 Jul 2010
    Link to this post
    Hello Al,

    Thank you for getting back to me.

    The StartingNodeUrl property works with the SiteMap. If you choose a node from the site map the navigation control will be bound starting from this node inwards. In this train of thought if toy have About and Resources page as children of some page say ~/parent.aspx. You need to set the StartingNodeUrl to be ~/parent.aspx and then set the StartFromCurrentNode property to false. Then the utility navigation control will display only About and Resources children pages.

    For the main navigation you can either use the standard menus which will show all pages in site map. Or you can use this blog post to extend the controls to let you choose which pages to show.

    Greetings,
    Radoslav Georgiev
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  7. Al
    Al avatar
    33 posts
    Registered:
    28 Dec 2008
    27 Jul 2010
    Link to this post
    Hi Radoslav,

    That blog post looks like exactly what im trying to acheive. I've copied the example out, uploaded the control to sitefinity, and although I dont get an error, i also dont get the treeview displaying on my page. All i get is the label stating "Select a page from the tree".

    I have literally just copied the code directly from the post.

    Any thoughts as to why it is not working?

    Regards,
    higgsy
Register for webinar
7 posts, 0 answered