I have this working finally! It took some time but well worth it. I call the navigation template in my template="/" and it will show the nav based on what category you are in. If you are in the lowest level category, it will show the parententity categorylisting.
When in the lowest level, it does take extra time to build the nav it seems. Anyone have any suggestions for speeding it up or is it just my dev computer being slow?
Code:
<xsl:template name="navigation">
<xsl:choose>
<xsl:when test="count(/root/EntityHelpers/Category/descendant::Entity[ParentEntityID=/root/Runtime/CatID]) > 0">
<h3><xsl:value-of select="/root/EntityHelpers/Category/descendant::Entity[EntityID=$CategoryID]/Name" disable-output-escaping="yes" /></h3>
</xsl:when>
<xsl:otherwise>
<h3><xsl:value-of select="/root/EntityHelpers/Category/descendant::Entity[EntityID=/root/EntityHelpers/Category/descendant::Entity[EntityID=$CategoryID]/ParentEntityID]/Name" disable-output-escaping="yes" /></h3>
</xsl:otherwise>
</xsl:choose>
<xsl:apply-templates select="/root/EntityHelpers/Category/descendant::Entity[EntityID=$CategoryID]"></xsl:apply-templates>
</xsl:template>
<xsl:template match="Entity">
<ul class="side-menu side-info">
<xsl:choose>
<xsl:when test="count(/root/EntityHelpers/Category/descendant::Entity[ParentEntityID=/root/Runtime/CatID]) > 0">
<xsl:for-each select="/root/EntityHelpers/Category/descendant::Entity[ParentEntityID=/root/Runtime/CatID]">
<li><a href="{aspdnsf:EntityLink(EntityID, SEName, 'category', 0, '')}" title="{Name}"><xsl:value-of select="Name" disable-output-escaping="yes"/></a></li>
</xsl:for-each>
</xsl:when>
<xsl:otherwise>
<xsl:for-each select="/root/EntityHelpers/Category/descendant::Entity[ParentEntityID=/root/EntityHelpers/Category/descendant::Entity[EntityID=/root/Runtime/CatID]/ParentEntityID]">
<xsl:choose>
<xsl:when test="EntityID = /root/Runtime/CatID">
<li><a href="{aspdnsf:EntityLink(EntityID, SEName, 'category', 0, '')}" title="{Name}" class="current"><xsl:value-of select="Name" disable-output-escaping="yes"/></a></li>
</xsl:when>
<xsl:otherwise>
<li><a href="{aspdnsf:EntityLink(EntityID, SEName, 'category', 0, '')}" title="{Name}"><xsl:value-of select="Name" disable-output-escaping="yes"/></a></li>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
</xsl:otherwise>
</xsl:choose>
</ul>
</xsl:template>