Hi all
I'm looking for either a match pattern, or a select statement which will allow me to restrict the node set.
I have the following document_type structure:
Code:</>
<dt_A> a1
<dt_B> b1
<dt_A> a2
<dt_B> b2
<dt_C> c1
<dt_B> b3
<dt_C> c2
What I want is when $currentPage is anything below node a1 (of type dt_A), then to show my xslt navigation (code below)
ie: If I'm on node a2, then prev=b1 and next=b3
However, if I'm on node a1, then don't show prev or next
At the moment I can't figure out how to restrict my node set! :-(
Here is my xslt:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:Stylesheet [ <!ENTITY nbsp " "> ]>
<xsl:stylesheet
version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:msxml="urn:schemas-microsoft-com:xslt"
xmlns:umbraco.library="urn:umbraco.library"
exclude-result-prefixes="msxml umbraco.library">
<xsl:output method="xml" omit-xml-declaration="yes"/>
<xsl:param name="currentPage"/>
<!-- this matches all nodes, which it too much! -->
<xsl:template match="/">
<!-- this doesn't match anything, but I'm looking for all children of 'Preparation' node-->
<!--
<xsl:template match="/*[@nodeName = 'Preparation']/*">
-->
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tr>
<td align="left">
<xsl:for-each select="$currentPage/preceding-sibling::node">
<xsl:if test="@sortOrder=$currentPage/@sortOrder - 1
and
string(data [@alias='umbracoNaviHide']) != '1'">
<a href="{umbraco.library:NiceUrl(@id)}">
<< <xsl:value-of select="data [@alias = 'PageTitle']"/>
</a>
</xsl:if>
</xsl:for-each>
</td>
<td align="right">
<xsl:for-each select="$currentPage/following-sibling::node">
<xsl:if test="@sortOrder=$currentPage/@sortOrder + 1
and
string(data [@alias='umbracoNaviHide']) != '1'">
<a href="{umbraco.library:NiceUrl(@id)}">
<xsl:value-of select="data [@alias = 'PageTitle']"/> >>
</a>
</xsl:if>
</xsl:for-each>
</td>
</tr>
</table>
</xsl:template>
</xsl:stylesheet>
Thanks!
Steve