Tags:
create new tag
view all tags

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

TWiki version: TWikiRelease01Feb2003
TWiki plugins: DefaultPlugin, EmptyPlugin, InterwikiPlugin
Server OS:  
Web server:  
Perl version:  
Client OS:  
Web Browser:  

-- 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

Edit | Attach | Watch | Print version | History: r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r2 - 2004-03-27 - PeterThoeny
 
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2026 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.