<xsl:for-each select="$currentPage/descendant::* [@isDoc and string(umbracoNaviHide) != '1']">
<xsl:if test="./parent::node/highlight = 1"> Show some nodes
</xsl:if>
the "." gets a reference to the current node and /parent::node/ gets the parent node.
But actually if you want to *only* get the highlighted values you could do filter that in the XPath directly
get parent node
I am iteratiing through all nodes in my content like this:
<xsl:for-each select="$currentPage/descendant::* [@isDoc and string(umbracoNaviHide) != '1']">
I need to be able to show the parent node of say:
Products
Product category 1
Product
<xsl:for-each select="$currentPage/descendant::* [@isDoc and string(umbracoNaviHide) != '1']">
<xsl:if test="highlight = 1">
I need to put code here to show the parent node of the nodes included by the if-statement
</xsl:if>
I have seen other threads about this but no luck for me so far :)
This page should help you out http://our.umbraco.org/wiki/reference/xslt/xpath-axes-and-their-shortcuts
Here's what you;re asking for I think
<xsl:for-each select="$currentPage/descendant::* [@isDoc and string(umbracoNaviHide) != '1']"> <xsl:if test="./parent::node/highlight = 1">
Show some nodes </xsl:if>
the "." gets a reference to the current node and /parent::node/ gets the parent node.
But actually if you want to *only* get the highlighted values you could do filter that in the XPath directly
Rich
Maybe I was a little confusing..I want to show the parent of the current node caught in the if-statement
So if product1 is caught in the if-statement - I wish to show what productcategory product1 belongs to
Great page by the way.
Like this?
Just like that.
Only problem is that it finds no parent node :) Atleast it shows no output!
It might work if you do it like
- Webspas
is working on a reply...