I recently discovered that XSLT search is also returning nodes with no template asigned to them. This means that the search results will link to invalid pages.
To overcome this I inserted one line in the xslt file. ' and @template > 0 '
Can anyone see a problem with this approach
Line 163:
<!-- reduce the number of nodes for applying all the functions in the next step --> <xsl:variable name="possibleNodes" select="$items/descendant-or-self::*[ @isDoc and string(umbracoNaviHide) != '1' and @template > 0 and count(attribute::id)=1 and (umbraco.library:IsProtected(@id, @path) = false() or umbraco.library:HasAccess(@id, @path) = true()) ]"/>
You should create a new thread so a thread doesn't cover many different issues - but you can do the same in a single chunk, using the ancestor-or-self:: axis:
XSLT search - no template nodes
I recently discovered that XSLT search is also returning nodes with no template asigned to them.
This means that the search results will link to invalid pages.
To overcome this I inserted one line in the xslt file. ' and @template > 0 '
Can anyone see a problem with this approach
Hi Søren,
Nope - that should be fine - does it work? :-)
/Chriztian
Of cause it does :-)
just thought I would share.
My problem was sonthing like that, paths, that's the problem.
I've created a Variable for node (items), where ITEMS = ROOT, ITEMS2 = ../ROOT and ../../ROOT
TRY THIS SAMPLE:
<xsl:variable name="items" select="$currentPage/*[@isDoc and @level = 2]/* [@isDoc and string(umbracoNaviHide) != '1']"/>
<xsl:variable name="items2" select="$currentPage/../*[@isDoc and @level = 2]/* [@isDoc and string(umbracoNaviHide) != '1']"/>
<xsl:variable name="items3" select="$currentPage/../../*[@isDoc and @level = 2]/* [@isDoc and string(umbracoNaviHide) != '1']"/>
<xsl:if test="count($items) > 0">
<ul>
<xsl:for-each select="$items">
<li>
<a href="{umbraco.library:NiceUrl(@id)}">
<xsl:value-of select="@nodeName"/>
</a>
</li>
</xsl:for-each>
</ul> </xsl:if>
<xsl:if test="count($items2) > 0">
<ul>
<xsl:for-each select="$items2">
<li>
<a href="{umbraco.library:NiceUrl(@id)}">
<xsl:value-of select="@nodeName"/>
</a>
</li>
</xsl:for-each>
</ul> </xsl:if>
<xsl:if test="count($items3) > 0">
<ul>
<xsl:for-each select="$items3">
<li>
<a href="{umbraco.library:NiceUrl(@id)}">
<xsl:value-of select="@nodeName"/>
</a>
</li>
</xsl:for-each>
</ul> </xsl:if>
Hi LUIZ,
You should create a new thread so a thread doesn't cover many different issues - but you can do the same in a single chunk, using the ancestor-or-self:: axis:
/Chriztian
is working on a reply...