Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
<xsl:if test="count($items) > 0"> <ul> <xsl:for-each select="$items"> <xsl:variable name="items1" select="@nodeName/ancestor-or-self::* [@isDoc and @level = 3]/* [@isDoc and string(umbracoNaviHide) != '1']" /> <xsl:choose> <xsl:when test="count($items1) > 0"> <li id="{concat('li_',position())}" onclick="leftmenutoogle('{position()}')" class="leftmenu_arrow"> <a href="#"> <xsl:value-of select="@nodeName" /> </a> <div class="lmenu_level2" id="{concat('menu_',position())}" style="display: none;"> <ul> <xsl:for-each select="$items1"> <li>
<a href="{umbraco.library:NiceUrl(@id)}?id={I want to get the li ID}"> <xsl:value-of select="@nodeName" /> </a>
</li> </xsl:for-each> </ul> </div> </li> </xsl:when> </xsl:choose> </xsl:for-each> </ul> </xsl:if>
for example :
if the li id is li_1
then i want this id in
<a href="{umbraco.library:NiceUrl(@id)}?id={li_1}
you need to use current()/@id
no its not working...
i need <li id="{concat('li_',position())}"
which is li_1 and li_2 if there are two parents...
i need this id in querystring of anchor tab. of foreach loop
<a href="{umbraco.library:NiceUrl(@id)}?id={I want to get the li ID}">
i want this:
<a href="{umbraco.library:NiceUrl(@id)}?id={li_1}">
Try:
<xsl:if test="count($items) > 0"> <ul> <xsl:for-each select="$items"> <xsl:variable name="items1" select="@nodeName/ancestor-or-self::* [@isDoc and @level = 3]/* [@isDoc and string(umbracoNaviHide) != '1']" /> <xsl:choose> <xsl:when test="count($items1) > 0">
<xsl:variable name="LIID" select="concat('li_',position())" /> <li id="{$LIID}" onclick="leftmenutoogle('{position()}')" class="leftmenu_arrow"> <a href="#"> <xsl:value-of select="@nodeName" /> </a> <div class="lmenu_level2" id="{concat('menu_',position())}" style="display: none;"> <ul> <xsl:for-each select="$items1"> <li>
<a href="{umbraco.library:NiceUrl(@id)}?id={$LIID}"> <xsl:value-of select="@nodeName" /> </a>
Thanks Craiq...
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
how to get the li id in foreach loop of xsl?
<xsl:if test="count($items) > 0">
<ul>
<xsl:for-each select="$items">
<xsl:variable name="items1" select="@nodeName/ancestor-or-self::* [@isDoc and @level = 3]/* [@isDoc and string(umbracoNaviHide) != '1']" />
<xsl:choose>
<xsl:when test="count($items1) > 0">
<li id="{concat('li_',position())}" onclick="leftmenutoogle('{position()}')" class="leftmenu_arrow">
<a href="#">
<xsl:value-of select="@nodeName" />
</a>
<div class="lmenu_level2" id="{concat('menu_',position())}" style="display: none;">
<ul>
<xsl:for-each select="$items1">
<li>
<a href="{umbraco.library:NiceUrl(@id)}?id={I want to get the li ID}">
<xsl:value-of select="@nodeName" />
</a>
</li>
</xsl:for-each>
</ul>
</div>
</li>
</xsl:when>
</xsl:choose>
</xsl:for-each>
</ul>
</xsl:if>
for example :
if the li id is li_1
then i want this id in
<a href="{umbraco.library:NiceUrl(@id)}?id={li_1}
you need to use current()/@id
no its not working...
i need <li id="{concat('li_',position())}"
which is li_1 and li_2 if there are two parents...
i need this id in querystring of anchor tab. of foreach loop
<a href="{umbraco.library:NiceUrl(@id)}?id={I want to get the li ID}">
i want this:
<a href="{umbraco.library:NiceUrl(@id)}?id={li_1}">
Try:
<xsl:if test="count($items) > 0">
<ul>
<xsl:for-each select="$items">
<xsl:variable name="items1" select="@nodeName/ancestor-or-self::* [@isDoc and @level = 3]/* [@isDoc and string(umbracoNaviHide) != '1']" />
<xsl:choose>
<xsl:when test="count($items1) > 0">
<xsl:variable name="LIID" select="concat('li_',position())" />
<li id="{$LIID}" onclick="leftmenutoogle('{position()}')" class="leftmenu_arrow">
<a href="#">
<xsl:value-of select="@nodeName" />
</a>
<div class="lmenu_level2" id="{concat('menu_',position())}" style="display: none;">
<ul>
<xsl:for-each select="$items1">
<li>
<a href="{umbraco.library:NiceUrl(@id)}?id={$LIID}">
<xsl:value-of select="@nodeName" />
</a>
</li>
</xsl:for-each>
</ul>
</div>
</li>
</xsl:when>
</xsl:choose>
</xsl:for-each>
</ul>
</xsl:if>
Thanks Craiq...
is working on a reply...