SharePoint: Enabling Dynamic Navigation on the Left Nav Menu

I’ve been modifying SharePoint’s Left nav menu, as I’m sure I’ve mentioned. Well, here’s the before and after styling, for the curious:

The next requirement that came up was to enable Dynamic menus on the left navigation. This is actually pretty easy:

  1. Open up your master page in SharePoint Designer
  2. Find the sharepoint:aspmenu control for the left nav
  3. Set the MaximumDynamicDisplayLevels to 1 or more

As an experiment, I did this (I’ve highlighted the dynamic menu ‘cos it wasn’t really styled yet, and so wasn’t very visible):

However, we’ve just hit a snag. It started right at the point where we editted our master page.

You’ll notice that the page has a ‘View All Site Content‘ link. This goes to the page viewlsts.aspx – which is an application page in the LAYOUTS directory, and so does not use our master page and will not have our dynamic menus.

Arse. Where does it get this left hand navigation then? Most Application Pages don’t have any left navigation. viewlsts.aspx defines it’s own – which happens to be identical to the default content of the default master page’s left nav.

So what can we do? We can’t modify viewlsts.aspx – it’s in the _layouts directory, and Microsoft are specific about not modifying stuff in there.

  • Remove all links to it, pretend it isn’t there. I’d sooner not – it’s a useful page.
  • Live with it. So the View All Site content page has navigation inconsistent to the rest of the site – get over it.
  • Increase the permissions to see the View All Site Content link. By default, it’s presented inside an SPSecurityTrimmedControl, just with very low permissions defined. Increase this to admin level, and then have them live with inconsistent navigation on the ‘admin’ page
  • Replace viewlsts.aspx.

We can’t modify viewlsts.aspx – but we can replace it. We could take a copy, and modify that – Microsoft don’t mind that – to use our dynamic navigation. We can put this new copy in the _layouts directory. We’ll then need to update the links in our site:

  1. One link is coded into the master page. Just update the URL the SPLinkButton to it.
  2. The other is in the Site Actions Menu. This ought to be possible, but I haven’t really had a look yet.

Hope that helps!

SharePoint: Enabling Dynamic Navigation on the Left Nav Menu

3 thoughts on “SharePoint: Enabling Dynamic Navigation on the Left Nav Menu

  1. Erik says:

    How do you actually copy thew viewlsts.aspx file, in other words, how do you find the “_layouts” directory? In sharepoint designer it doesn’t show up in the folder list.

  2. Ah, yes. _layouts isn’t in SharePoint’s virtual file system, so it won’t show up in SharePoint Designer. You’ll find it on one of the drives, typically in

    c:program filescommon filesmicrosoft sharedweb server extensions12templateslayouts

    (I think – it’s somewhere near there)

Leave a reply to Erik Cancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.