Until
Tasks.Item8893 is resolved, the
excludeweb
parameter of
VarSEARCH only excludes the web specified; its subwebs are still candidates for any search result.
For example, consider the following search:
%SEARCH{
"name='WebHome'"
type="query"
web="all"
recurse="on"
nonoise="on"
format=" * [[$web.$topic][$topic]]"
}%
Test:
Let's exclude Extensions web and all its subwebs. Sadly, this won't work, due to an open bug
Tasks.Item8893:
%SEARCH{
"name='WebHome'"
type="query"
web="all,-Extensions"
recurse="on"
nonoise="on"
format=" * [[$web.$topic][$topic]]"
}%
So, let's try nesting a different SEARCH inside the outer SEARCH:
%SEARCH{
"name='WebHome'"
type="query"
web="all,%SEARCH{
"1"
type="query"
recurse="on"
web="Extensions"
topic="%WEBPREFSTOPIC%"
nonoise="on"
format="-$web"
separator=", "
}%"
recurse="on"
nonoise="on"
format=" * [[$web.$topic][$topic]]"
}%
Test:
How it works
Refer to the
description of inside-out, left-to-right macro expansion documentation: the inner SEARCH expanded first, which was:
%SEARCH{
"1"
type="query"
recurse="on"
web="Extensions"
topic="%WEBPREFSTOPIC%"
nonoise="on"
format="-$web"
separator=", "
}%
Result:
-Extensions, -Extensions/Archived, -Extensions/Testing
And so the
outer SEARCH actually saw this, prior to expansion:
* [[About.WebHome][WebHome]]
* [[Community.WebHome][WebHome]]
* [[Community/Developers.WebHome][WebHome]]
* [[Development.WebHome][WebHome]]
* [[Download.WebHome][WebHome]]
* [[Home.WebHome][WebHome]]
* [[Main.WebHome][WebHome]]
* [[Sandbox.WebHome][WebHome]]
* [[Support.WebHome][WebHome]]
* [[Support/ClientSupport.WebHome][WebHome]]
* [[Support/Question922.WebHome][WebHome]]
* [[System.WebHome][WebHome]]
* [[Tasks.WebHome][WebHome]]
* [[Tasks/Testcases.WebHome][WebHome]]
* [[Trash/MiguelSandbox.WebHome][WebHome]]
* [[Trash/NC.WebHome][WebHome]]
* [[Trash/PoojaBedur.WebHome][WebHome]]
* [[Trash/StefanKrüger.WebHome][WebHome]]
* [[Trash/Subweb.WebHome][WebHome]]
See also