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'm am getting errors with the following code. ( i've turned skip testing on )
the following line returns @id : "1332"
node/descendant-or-self::node [@nodeTypeAlias = 'productFabrics']/@id
however when i use this value on niceUrl i get a parsing error.
~~~~
<xsl:for-each select="$currentPage/node [string(data [@alias='umbracoNaviHide']) != '1']">
<a href="{umbraco.library:NiceUrl(node/descendant-or-self::node [@nodeTypeAlias = 'productFabrics']/@id)}">
<xsl:value-of select="@nodeName"/>
</a>
</xsl:for-each>
if i use $currentPage it returns a value. Any thoughts what going on here.
some more info. Here is error
Error parsing XSLT file: \xslt\ProductRangeList.xslt
When i "?umbDebugShowTrace=true" the stacktrace doesn't actually show an exception.
add xsl if
<xsl:for-each select="$currentPage/node [string(data [@alias='umbracoNaviHide']) != '1']"> <xsl:variable name="id" select="node/descendant-or-self::node [@nodeTypeAlias = 'productFabrics']/@id" /> <xsl:if test="$id != ''"> <a href="{umbraco.library:NiceUrl($id)}"> <xsl:value-of select="@nodeName"/> </a> </xsl:if></xsl:for-each>
But it looks it can be simplified like this
<xsl:for-each select="$currentPage/node [string(data [@alias='umbracoNaviHide']) != '1']/descendant-or-self::node [@nodeTypeAlias = 'productFabrics']"> <a href="{umbraco.library:NiceUrl(@id)}"> <xsl:value-of select="@nodeName"/> </a></xsl:for-each>
Petr
cool, thanks petr!
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
NiceUrl from foreach
I'm am getting errors with the following code. ( i've turned skip testing on )
the following line returns @id : "1332"
node/descendant-or-self::node [@nodeTypeAlias = 'productFabrics']/@id
however when i use this value on niceUrl i get a parsing error.
~~~~
<xsl:for-each select="$currentPage/node [string(data [@alias='umbracoNaviHide']) != '1']">
<a href="{umbraco.library:NiceUrl(node/descendant-or-self::node [@nodeTypeAlias = 'productFabrics']/@id)}">
<xsl:value-of select="@nodeName"/>
</a>
</xsl:for-each>
if i use $currentPage it returns a value. Any thoughts what going on here.
some more info. Here is error
Error parsing XSLT file: \xslt\ProductRangeList.xslt
When i "?umbDebugShowTrace=true" the stacktrace doesn't actually show an exception.
add xsl if
But it looks it can be simplified like this
<xsl:for-each select="$currentPage/node [string(data [@alias='umbracoNaviHide']) != '1']/descendant-or-self::node [@nodeTypeAlias = 'productFabrics']">
<a href="{umbraco.library:NiceUrl(@id)}">
<xsl:value-of select="@nodeName"/>
</a>
</xsl:for-each>
Petr
cool, thanks petr!
is working on a reply...