Get by document type only children of the current node
Hi,
I have an XSLT file which lists all pages of type "broker". Now I want to add a subtree with a copy of the site translated to Japanese. The problem is that now the XSLT is picking up both the nodes under the current page and the nodes under the translated copy of the current page. Here is the XSLT:
Get by document type only children of the current node
Hi,
I have an XSLT file which lists all pages of type "broker". Now I want to add a subtree with a copy of the site translated to Japanese. The problem is that now the XSLT is picking up both the nodes under the current page and the nodes under the translated copy of the current page. Here is the XSLT:
<xsl:param name="currentPage"/>
<xsl:template match="/">
<!-- start writing XSLT -->
<ul class="footer-broker-list">
<xsl:for-each select="$currentPage/ancestor-or-self::*//broker [@isDoc]">
<xsl:if test="string(umbracoNaviHide) != '1'">
<li>
<a>
<xsl:attribute name="href">
<xsl:value-of select="umbraco.library:NiceUrl(current()/@id)"/>
</xsl:attribute>
<xsl:attribute name="style">
text-decoration: none;
</xsl:attribute>
<xsl:value-of select="./brokerName" /></a></li>
</xsl:if>
</xsl:for-each>
</ul>
</xsl:template>
How can I modify this XSLT so it only looks at direct children of the current page?
Thank you!
Hi Elad,
I think you can do it with this xpath expression
<xsl:for-each select="$currentPage/broker [@isDoc]">
Hope it works for you.
/Dennis
The problem is that the list is displayed on all the pages.
This would work if I used the list macro only on the parent page.
Okay,
I think you have to go up to the root in your tree and then list all the pages of the broker document type.
Maybe, something like this, will solve your question.
<xsl:for-each select="$currentPage/ancestor-or-self::broker [@isDoc]">
Hopefully this will help you further.
/Dennis
Hi Elad,
Assuming both your English and your Japanese sites are sibling nodes of the doctype Frontpage, you could do this:
is working on a reply...