views:

309

answers:

0

I'm working on a custom current (left) navigation on a SharePoint solution.

What I need is that the root of the navigation is a variation web, the immediate child of the root web. All the sites and pages which are immediate children of this variation should be visible, though not expanded. Only sites which are ancestors of the current site should be expanded... all the way down to the current site/page.

An example... if I start on page http://spsite.ex/variation/site2/subsite2.1/subsite2.1.1/subsite2.1.1.3/page.aspx I should see...

Site1
Site2
    SubSite2.1
        SubSite2.1.1
            SubSite2.1.1.1
            SubSite2.1.1.2
            SubSite2.1.1.3
                page.aspx (YOU ARE HERE)
    SubSite2.2
    Site2Page1
    Site2Page2
Site3
Site4
Site5

If I then click on the link for SubSite2.1 I should see something like...

Site1
Site2
    SubSite2.1 (YOU ARE HERE)
        SubSite2.1.1
    SubSite2.2
    Site2Page1
    Site2Page2
Site3
Site4
Site5

If I then navigate to http://spsite.ex/variation/site5/subsite5.1/page.aspx I should see something like...

Site1
Site2
Site3
Site4
Site5
    SubSite5.1
        SubSite5.1.1
        page.aspx (YOU ARE HERE)

I've written a solution, but I feel like it's not one I should feel proud of; I've given the AspMenu a near-inifinite StaticDisplayLevels and then extended PortalSiteMapProvider, overriding GetChildNode(node) to not get child nodes, except for ancestors of the current web.