Note that there are some explanatory texts on larger screens.

plurals
  1. POSharePoint Custom Current Navigation / PortalSiteMapProvider
    text
    copied!<p>I'm working on a custom current (left) navigation on a SharePoint solution.</p> <p>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.</p> <p>An example... if I start on page <code>http://spsite.ex/variation/site2/subsite2.1/subsite2.1.1/subsite2.1.1.3/page.aspx</code> I should see...</p> <pre><code>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 </code></pre> <p>If I then click on the link for <code>SubSite2.1</code> I should see something like...</p> <pre><code>Site1 Site2 SubSite2.1 (YOU ARE HERE) SubSite2.1.1 SubSite2.2 Site2Page1 Site2Page2 Site3 Site4 Site5 </code></pre> <p>If I then navigate to <code>http://spsite.ex/variation/site5/subsite5.1/page.aspx</code> I should see something like...</p> <pre><code>Site1 Site2 Site3 Site4 Site5 SubSite5.1 SubSite5.1.1 page.aspx (YOU ARE HERE) </code></pre> <p>I've written <em>a</em> solution, but I feel like it's not one I should feel proud of; I've given the <code>AspMenu</code> a near-inifinite <code>StaticDisplayLevels</code> and then extended <code>PortalSiteMapProvider</code>, overriding <code>GetChildNode(node)</code> to <em>not</em> get child nodes, except for ancestors of the current web.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload