If you remember in MOSS extending left nav was not a trivial task. If you wanted to use anything else except navigation control – you would have to provision it to the site. If you wanted to extend out of the box navigation you would have to extend existing classes or sometime rewrite out of the box logic and include your customization this way.
In SharePoint 2010 things are way different, left nav can be just a set of webpart zones allowing you to add webparts to it. Let`s take a look at the blog template and edit a default page of the Blog:
Blog Navigator, is the zone that will handle the left nav. Now that our navigation is just a webpart we can take advantage of XsltListViewWebPart and have our navigation dynamically generated depending on items in a list. For blog this is very appropriate since we have categories that are list entries and having them aggregated this way is very simple.
Here is how something like this would look like (taken straight from my ONET.XML)
<View List=”301″ BaseViewID=”8″ WebPartZoneID=”Left” WebPartOrder=”1″><![CDATA[
<webParts>
<webPart xmlns="http://schemas.microsoft.com/WebPart/v3"><metaData><type name="Microsoft.SharePoint.WebPartPages.XsltListViewWebPart,Microsoft.SharePoint,Version=14.0.0.0,Culture=neutral,PublicKeyToken=71e9bce111e9429c" />
<importErrorMessage>Cannot import this Web Part.</importErrorMessage></metaData>
<data>
<properties>
<property name="AllowConnect" type="bool">True</property>
<property name="ChromeType" type="chrometype">None</property>
<property name="AllowClose" type="bool">False</property>
</properties>
</data>
</webPart>
</webParts>
]]></View>
Above is just a XSL view of the list defined in my list schema.xml, here is a part of it:
<View BaseViewID=”8″ FreeForm=”TRUE” Type=”HTML” ReadOnly=”TRUE”>
<XslLink>main.xsl</XslLink>
You`ll notice the reference to main.xsl which is a default XSL that will be used to style the navigation. You can provision your own XSL and define you own styling rules and here is the short video on how to do that.
The result, dynamic left nav rendered as we want it to render:
Enjoy!