i am trying to generate two level menu using xslt. for the first level menu i need to get the value of document property called MenuClassName. but it doesn't work, this is the code.
<xsl:param name="currentPage"/>
<!-- Input the documenttype you want here --> <xsl:variable name="level" select="1"/>
access document properties
Hi all,
i am new to umbraco and xslt
i am trying to generate two level menu using xslt. for the first level menu i need to get the value of document property called MenuClassName. but it doesn't work, this is the code.
<xsl:param name="currentPage"/>
<!-- Input the documenttype you want here -->
<xsl:variable name="level" select="1"/>
<xsl:template match="/">
<!-- The fun starts here -->
<ul class="menu">
<xsl:for-each select="$currentPage/ancestor-or-self::node [@level=$level]/node [string(data [@alias='umbracoNaviHide']) != '1']">
<li>
<a href="{umbraco.library:NiceUrl(@id)}">
<xsl:value-of select="@nodeName"/>
<xsl:value-of select="current()[string(data [@alias='MenuClassItem'])]"/>
</a>
<ul class="acitem">
<xsl:for-each select="current()/node [string(data [@alias='umbracoNaviHide']) != '1']">
<li>
<a href="{umbraco.library:NiceUrl(@id)}">
<xsl:value-of select="@nodeName"/></a>
</li>
</xsl:for-each>
</ul>
</li>
</xsl:for-each>
</ul>
</xsl:template>
Ahmed, what version of Umbraco are you using? Do you have the legacy schema turn on or off?
If you are using the new schema you can do a for each such as this:
and then use:
You dont need to use current() and the data alias etc parts in the new schema
If your using the old schema i will add another post.
What is the current output you are getting from your existing XSLT?
hi, thanks for your replay.
my umbraco version was 4.0.3 now i upgraded into 4.5.2 and i left the legacy schema false
and i created the xslt file again and modified it and now it's working.
is working on a reply...