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
I have created such loop
<xsl:template match="/"> <ul class="mainTabSection"> <xsl:for-each select="$currentPage/node [string(data [@alias='umbracoNaviHide']) != '1']"> <li> <xsl:variable name="i" select="position()" /> <xsl:copy> <xsl:value-of select="concat('#tab', $i)"/> </xsl:copy> </li> </xsl:for-each> </ul> </xsl:template>
What I need to achieve is to get the following result
<ul class="mainTabSection"> <li><a href="#tab1">link name</a></li> <li><a href="#tab2">link name</a></li> <li><a href="#tab3">link name</a></li> </ul>
but I do not know how to wrap "<a href=""></a> with increased tab number.
Hi ds,
position() is your friend:
<a href="#tab{position()}"> ... </a>
/Chriztian
Thanks Chriztian,
I changed code snippet and it is working as it is expected.
<xsl:template match="/"> <ul class="mainTabSection"> <xsl:for-each select="$currentPage/node [string(data [@alias='umbracoNaviHide']) != '1']"> <li> <a href="#tab{position()}"><xsl:value-of select="data [@alias = 'tabLink']"/></a> </li> </xsl:for-each> </ul> </xsl:template>
thx,
ds
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.
Continue discussion
how to concatenate increased number into href tag?
I have created such loop
What I need to achieve is to get the following result
but I do not know how to wrap "<a href=""></a> with increased tab number.
Hi ds,
position() is your friend:
/Chriztian
Thanks Chriztian,
I changed code snippet and it is working as it is expected.
thx,
ds
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.