Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
How can I exclude pages that have been redirected using "umbracoRedirect" from displaying in the search results?
<xsl:variable name="possibleNodes" select="$items/descendant-or-self::*[
and string(umbracoNaviHide) != '1'
and name() != 'ImageGalleryPhoto' <!-- Hide doctype from search -->
and string(umbracoRedirect) != '1'
and (umbraco.library:IsProtected(@id, @path) = false()
or umbraco.library:HasAccess(@id, @path) = true())
The XML value stored against a page with umbracoRedirect (in this case a property called 'umbRedirect' contains a node ID, like so:
So, you need a check to make sure to exclude any page where that value exists, so something like:
and string-length(umbRedirect) = 0
I'd rewrite that whole expression as the following:
<xsl:variable name="possibleNodes" select="
[not(umbracoNaviHide = 1)]
[not(umbraco.library:IsProtected(@id, @path)) or umbraco.library:HasAccess(@id, @path)]
Thanks Chriztian, that works perfectly! Cheers!
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted