You can modify the XSLT to exclude certain Doc Types, which will achieve you need, or you could modify the XSLT to *only* search the Lev1 doctype.
Of course you can filter only certain fields within the Macro, so unless Lev1 / Sub1 have the same property alias (bodyText etc.) they will never be searched.
<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()) ]"/>
But do you want to exclude all pages at the levels under level 3? This would be all pages under Sub 1, Sub2 and Sub3? Or only nodes under Sub2?
If you only want to exclude nodes under Sub2, I think you should create a true/false property (called excludeFromSearch in the below code) that can be checked if a node should be excluded from the search. Then you can change the above code to this:
<xsl:variable name="possibleNodes" select="$items/descendant-or-self::*[ @isDoc and string(umbracoNaviHide) != '1' and string(excludeFromSearch) != '1' and count(attribute::id)=1 and (umbraco.library:IsProtected(@id, @path) = false() or umbraco.library:HasAccess(@id, @path) = true()) ]"/>
Exclude subpages
Hi
Is it possible to exclude a certain part of the content-tree from the search?
Let's say I have the following structure and I want XSLTSearch to exclude Sub2 (and children) from the search...
Lev1
- Sub1
-- Sub11
Lev2
- Sub2
-- Sub21
-- Sub22
Lev3
- Sub3
-- Sub31
Hey Peter,
You can modify the XSLT to exclude certain Doc Types, which will achieve you need, or you could modify the XSLT to *only* search the Lev1 doctype.
Of course you can filter only certain fields within the Macro, so unless Lev1 / Sub1 have the same property alias (bodyText etc.) they will never be searched.
Rich
Hi Peter
You should be able to exclude nodes that has a certain level. Or nodes under a certain level. Which version are you using?
Could you show us the "content" of the possibleNodes-variable?
/Kim A
I'm using XSLTsearch version 3.0.1
hmm, what do you mean by 'the "content" of the possibleNodes-variable'?
I was thinking of this line:
But do you want to exclude all pages at the levels under level 3? This would be all pages under Sub 1, Sub2 and Sub3? Or only nodes under Sub2?
If you only want to exclude nodes under Sub2, I think you should create a true/false property (called excludeFromSearch in the below code) that can be checked if a node should be excluded from the search. Then you can change the above code to this:
/Kim A
is working on a reply...