I'm using some pages as placeholders and want to exlude these from my search result.
Snippet from xslt search
<!-- 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 count(attribute::id)=1 and (umbraco.library:IsProtected(@id, @path) = false() or umbraco.library:HasAccess(@id, @path) = true()) ]"/>
When I run the search and place <xsl:value-of select="@template"/> after the description I get a value of 0 (zero). Which is perfect since my placeholder pages does not have any templates. Is there a way to use this in the above snippet using something like
Ok, then I guess it's matter of altering the variable to look like this
<xsl:variable name="possibleNodes" select="$items/descendant-or-self::*[ @isDoc and @template = 0 and string(umbracoNaviHide) != '1' and count(attribute::id)=1 and (umbraco.library:IsProtected(@id, @path) = false() or umbraco.library:HasAccess(@id, @path) = true()) ]"/>
Exlude null templates from xslt search
Hi
I'm using some pages as placeholders and want to exlude these from my search result.
Snippet from xslt search
<!-- 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 count(attribute::id)=1
and (umbraco.library:IsProtected(@id, @path) = false()
or umbraco.library:HasAccess(@id, @path) = true())
]"/>
When I run the search and place <xsl:value-of select="@template"/> after the description I get a value of 0 (zero). Which is perfect since my placeholder pages does not have any templates. Is there a way to use this in the above snippet using something like
and @template = 0
Thanks!
/ Niklas
Hi Niklas
Isn't just a matter of using the "umbracoNaviHide" on your placeholder document types? That should exclude them from the results.
/Jan
Hi Jan
Yes that would work and I started doing that at first but then I realized I would have to to go through over 2000 pages which seemed a bit tedious :)
/ Niklas
Hi Niklas
Ok, then I guess it's matter of altering the variable to look like this
<xsl:variable name="possibleNodes" select="$items/descendant-or-self::*[
@isDoc
and @template = 0
and string(umbracoNaviHide) != '1'
and count(attribute::id)=1
and (umbraco.library:IsProtected(@id, @path) = false()
or umbraco.library:HasAccess(@id, @path) = true())
]"/>
Hope this helps.
/Jan
Hi Jan
I'm afraid this didn't do the trick. Any more ideas?
Regards / Niklas
is working on a reply...