Since the new control has hard coded HTML in it, we cannot use it in most cases. Here is what we did instead - this is just for your reference, it's a working example but could be improved certainly.
1. Add a tag to template.master in place of the aspdnsf:EntityControl tags that output these new menu controls:
Code:
<asp:Literal ID="leftNavCat" runat="server" Text="<%$ Tokens:XMLPACKAGE, vibe.categories.xml.config%>" />
You can change the name of the xmlpackage or ID, this is just for reference.
Then make sure you have the following xmlpackage in your XmlPackages folder.
NOTE: this xmlpackage still works for parent level menus, but because a lot of the v9 XMLPackage System / Runtime information is now missing or changed, some of these tests simply fail because that data is not there anymore
I'm hoping that will be changed because there was some useful data there that made developing xmlpackages on the fly very easy. For example, /root/System/PageName no longer shows the actual underlying file name like showcategory.aspx, but instead it shows c-1-test-cat.aspx, which is already available in several other places.
Code:
<?xml version="1.0" standalone="yes" ?>
<package version="2.1" displayname="Categories" debug="false" includeentityhelper="true">
<PackageTransform>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:aspdnsf="urn:aspdnsf" exclude-result-prefixes="aspdnsf">
<xsl:output method="html" omit-xml-declaration="yes"/>
<xsl:param name="CategoryID">
<xsl:choose>
<xsl:when test="/root/System/PageName = 'showmanufacturer.aspx' or /root/System/PageName = 'showsection.aspx' or /root/System/PageName = 'showdistributor.aspx' or /root/System/PageName = 'showvector.aspx' or /root/System/PageName = 'showgenre.aspx'">0</xsl:when>
<xsl:when test="/root/System/PageName = 'showcategory.aspx' and boolean(/root/QueryString/categoryid)">
<xsl:value-of select="/root/QueryString/categoryid"/>
</xsl:when>
<xsl:when test="(/root/System/PageName = 'showcategory.aspx' or /root/System/PageName = 'showproduct.aspx') and boolean(/root/Cookies/lastviewedentityinstanceid) and /root/Cookies/lastviewedentityname = 'Category'">
<xsl:value-of select="/root/Cookies/lastviewedentityinstanceid"/>
</xsl:when>
<xsl:otherwise>0</xsl:otherwise>
</xsl:choose>
</xsl:param>
<xsl:param name="AncestorID">
<xsl:for-each select="/root/EntityHelpers/Category//Entity[EntityID = $CategoryID]">
<xsl:value-of select="ancestor::*/EntityID"/>
</xsl:for-each>
</xsl:param>
<xsl:param name="ParentID">
<xsl:for-each select="/root/EntityHelpers/Category//Entity[EntityID = $CategoryID]">
<xsl:value-of select="parent::*/EntityID"/>
</xsl:for-each>
</xsl:param>
<xsl:template match="/">
<h3>Browse By Category</h3>
<ul>
<xsl:apply-templates select="/root/EntityHelpers/Category/Entity" />
</ul>
</xsl:template>
<xsl:template match="Entity">
<xsl:param name="eName" select="aspdnsf:GetMLValue(Name)" />
<li>
<a href="{concat('c-',EntityID,'-',SEName,'.aspx')}">
<xsl:if test="EntityID = $CategoryID or descendant::Entity/EntityID = $CategoryID">
<xsl:attribute name="class"><![CDATA[active]]></xsl:attribute>
</xsl:if>
<xsl:value-of select="$eName"/>
</a>
<xsl:if test="count(child::Entity)>0 and (EntityID = $CategoryID or descendant::Entity/EntityID = $CategoryID)">
<ul>
<xsl:apply-templates select="Entity" />
</ul>
</xsl:if>
</li>
</xsl:template>
</xsl:stylesheet>
</PackageTransform>
</package>