StartingNodeOffset in Sitefinity Navigation

Posted by Community Admin on 03-Aug-2018 06:40

StartingNodeOffset in Sitefinity Navigation

All Replies

Posted by Community Admin on 11-Oct-2012 00:00

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

Posted by Community Admin on 11-Oct-2012 00:00

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.

Posted by Community Admin on 11-Oct-2012 00:00

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

Posted by Community Admin on 11-Oct-2012 00:00

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.

www.sitefinity.com/.../submenu-navigation-2-levels 

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

Markus

Posted by Community Admin on 11-Oct-2012 00:00

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!

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

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

This thread is closed