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

Forums / General Discussions / StartingNodeOffset in Sitefinity Navigation

StartingNodeOffset in Sitefinity Navigation

6 posts, 0 answered
  1. Mike
    Mike avatar
    208 posts
    Registered:
    10 Dec 2007
    11 Oct 2012
    Link to this post
    I have a site with a fairly deep navigation, and the requirements dictate three navigation controls.  The site map looks like this:    Top of Site Map
        |__First Section
        |__Second Section
            |__Second Level Page 1
            |   |__Third Level Page 1
            |   |__Third Level Page 2
            |   |__Third Level Page 3
            |   |__Third Level Page 4
            |__Second Level Page 2
            |   |__Third Level Page 5
            |   |__Third Level Page 6
            |   |__Third Level Page 7
            |   |__Third Level Page 8
            |__Second Level Page 3
                |__Third Level Page 9
                |__Third Level Page 10
                |__Third Level Page 11
                |__Third Level Page 12

    And so on.  There are 5 top level sections to the site, each section has 6 second level pages.  Each second level page has a number of third level pages.  I have a global tabstrip nav bar for the top 5 sections of the site.  Then there is a secondary tab strip with the second level pages.  I had to create a separate template for each one of the top sections, just so I could have the second tab strip start at a given URL (the children of the section parent), even though there is no other difference between the templates.
           
    Now when I'm on the Second or Third Level page, there needs to be a left navigation control that shows the Second level page that is the ancestor, and it's children.  For example, if I'm on Third Level Page 6, the left navigation should show the Parent page (Second Level Page 2) and the third level pages under it, like this: 

    Second Level Page 2
        Third Level Page 5
        Third Level Page 6  <- Selected Page
        Third Level Page 7
        Third Level Page 8

    In the past, (the glory days of Sitefinity 3.x) this was easy using a StartingNodeOffset, and the nav control would count down from the top and always display the correct set of pages, no matter where you were on the Second Level or below.  Only one template needed.

    This doesn't seem to be supported any more, so how do I do it?  Don't say "configure a separate template for each and specify the starting page in the nav widget" because in this case it will mean at least 30 templates, JUST to handle this single requirement, because there are 5 second level pages and at least 6 third level pages below them.

    Really, creating new templates solely to specify a different starting node for the navigation is CRAZY.  Templates should be about page layout and things like that.  It's like using a shotgun to push a tack into a bulletin board.

    There appears to be a SiteMapDataSource, but there doesn't appear to be any way to connect the Navigation control to it.  If your navigation control doesn't support StartingNodeOffset, please tell me how to accomplish this.  It's a very common scenario when the left nav only shows the tree from a certain level down.

    Regards,
    Mike Sharp
  2. Jochem Bökkers
    Jochem Bökkers avatar
    787 posts
    Registered:
    13 Aug 2007
    11 Oct 2012
    Link to this post
    Hey Mike,

    Maybe I'm misunderstanding the problem but if you had navigation using ParentNode as the startingpoint instead of 5x6 StartingNode, you'd be home safe with 1 template no?

    Jochem.
  3. Mike
    Mike avatar
    208 posts
    Registered:
    10 Dec 2007
    11 Oct 2012 in reply to Jochem Bökkers
    Link to this post
    Hi Jochem,

    I guess I'm not quite following you.  In the Navigation designer, there are these options:
    • Top level pages
    • All pages under particular page
    • All pages under currently opened page

    If I choose All pages under particular page, then I need a template for each different particular page.  The left nav only shows up when you're on the Second Level Page or the Third Level Page.  AFAIK, this means I need a template for each possible Second Level Page, and there are at least 30 of them.

    If I choose All pages under currently opened page, then the left nav changes when I go between Second Level Page 2 and Third Level Page 6, for example.

    Is there a different way to configure this? I'm not sure how I specify ParentNode as the starting point, and even if I do, the parent node changes with context going between the two levels.

    Thanks,
    Mike

  4. Markus
    Markus avatar
    2763 posts
    Registered:
    25 Nov 2005
    11 Oct 2012 in reply to Mike
    Link to this post
    Dear Mike

    I usually enable the RadControls: Administration - Settings - Advanced - Toolboxitem and so on.

    Then I use a SiteMap Control and map it to SitefinitySiteMap and use whatever RadControl I like. Then the good old days with StartingNodeOffset are back.

    http://www.sitefinity.com/devnet/forums/general-discussions-/submenu-navigation-2-levels 

    Scroll down to 13 Oct 2011 and you have some screenshots.

    Markus
  5. Mike
    Mike avatar
    208 posts
    Registered:
    10 Dec 2007
    11 Oct 2012 in reply to Markus
    Link to this post
    Hi Markus,

    Ok, that might work; I didn't realize you could turn on the rest of the rad controls that way.  And the poor searchability of the this site right now has made it harder to find stuff out like this.  Thanks for the tip!

    I used to use the RadPanelBar for these, but I like the non-dynamic clean markup of the current nav controls...guess I can't have both.

    I'm still scratching my head as to why Telerik thought that the StartingNodeOffset wasn't necessary any more!
  6. Jochem Bökkers
    Jochem Bökkers avatar
    787 posts
    Registered:
    13 Aug 2007
    12 Oct 2012 in reply to Mike
    Link to this post
    Hey Mike,

    Sorry for the belated response, with notification out I wasn't aware you replied....

    Given the fact that the default vertical navigation widget has the option for 'All sibling pages of currently opened page' with the additional checkbox of 'show the parent' I assumed you were using a non sitefinity widget but an actual panelbar.

    If you want further 'cleanness' I'd take it one step further and build some custom logic to just output a ul/li.

    Jochem

6 posts, 0 answered