Question
I have a page where I want list all the webs except for Main web. I set the "nosearchall" variable to "no" in web preferences but that doesn't work. Here is my search code:
SEARCH{ "\* Set SITEMAPLIST \= on" regex="on" web="public%, all" nototal="on" nosearch="on" format=" [[$web.WebHome][$web]]$n $pattern(.*?\* Set SITEMAPWHAT\s*=([^\n\r]*).*)$n" }
Is there any way to hide Main web from a search? Thanks.
Environment
--
JasonLiu - 26 Mar 2004
Answer
You can do that with WEBLIST, CALC and SEARCH:
First you get the list of all public webs:
- You type:
%WEBLIST{separator=", "}%
- You get: Blog, Codev, Main, Plugins, Sandbox, Support, TWiki, TWiki01, TWiki02, TWiki03, TWiki04, TWiki04x01, TWiki04x02, TWiki04x03, TWiki05x00, TWiki05x01, TWiki06x00, TWiki06x01, WikiWed
- Notice that the Trash web is missing since it has the NOSEARCHALL flag set
Then you assign it to a
SpreadSheetPlugin variable:
- You type:
%CALC{$SET(weblist, %WEBLIST{separator=", "}%)}%
- (you do not get any output)
Finally issue a search that uses web="$GET(weblist)". The SEARCH needs to run after the CALC, that means the CALC needs to escape the SEARCH:
FYI, the WEBLIST returns the current web even if it has the NOSEARCHALL flag set. That means, the Main web will be in the list if you run the WEBLIST query in the Main web. To work around this, use a CALC to strip the Main web from the list, or run above query in a topic located in a different web, then INCLUDE the topic from the Main web.
--
PeterThoeny - 27 Mar 2004