create new tag
, view all tags
I think it might be better that TOPICLIST does not show the Web* topics unless specifically asked for. Many users complain that the Web* topics confuse them, especially when there are very few topics. If we did this, what would it break?

-- MartinCleaver - 16 May 2004

Patch attached. It gives TOPICLIST and excludetopic parameter that defaults to "Web*", so can be overridden.

TBH, I think that handleWebAndTopicList belongs in Search.pm but I didn't want to move it without first asking.

--- TWiki.pm.~1.341.~   2004-05-08 21:38:08.000000000 -0500
+++ TWiki.pm    2004-05-17 22:39:39.000000000 -0500
@@ -2496,10 +2496,12 @@
     my $web = extractNameValuePair( $theAttr, "web" ) || "";
     my $webs = extractNameValuePair( $theAttr, "webs" ) || "public";
     my $selection = extractNameValuePair( $theAttr, "selection" ) || "";
+    my $theExclude = extractNameValuePair( $theAttr, "excludetopic" ) || "Web*";
     $selection =~ s/\,/ /g;
     $selection = " $selection ";
     my $marker    = extractNameValuePair( $theAttr, "marker" ) || 'selected="selected"';
+    # Get topics
     my @list = ();
     if( $isWeb ) {
         my @webslist = split( /,\s?/, $webs );
@@ -2519,6 +2521,12 @@
             @list = &TWiki::Store::getTopicNames( $web );
+    #CodeSmell - this whole thing should be in Search.pm
+    # Exclude topics
+    $theExclude = TWiki::Search::_makeTopicPattern( $theExclude );  # E.g. "Web*, FooBar" ==> "^(Web.*|FooBar)$"  
+    @list = grep( !/$theExclude/, @list ) if( $theExclude ); 
+    # Format
     my $text = "";
     my $item = "";
     my $line = "";

-- MartinCleaver - 18 May 2004

please add the documentation that will acompany your proposal.

-- SvenDowideit - 04 Jul 2004

Here is the documentation for this feature.

< Topic index of a web. The "format" defines the format of one topic item. It may include variables: The $name variable gets expanded to the topic name; the $web variable gets expanded to the name of the web. Parameters are format, separator and web:  
> Topic index of a web. The "format" defines the format of one topic item. It may include variables: The $name variable gets expanded to the topic name; the $web variable gets expanded to the name of the web. Since 1 Aug 2004, the parameter of excludetopic="Web*" is supplied, thus hiding TWiki's special topics from normal view. To get the previous behaviour, supply excludetopic="" to override. Parameters are excludetopic, format, separator and web: 
    | ="excludetopic"="topicpattern" | Topics to hide | ="Web*"= |

-- MartinCleaver - 09 Jul 2004

This is a good little enhancement, consistent with SEARCH. However, I do not agree that we should suppress all Web* topics by default, it is not consistent and it does not work well with localized installations. Furthermore, with the current parser you can't unset a parameter with excludetopic="".

-- PeterThoeny - 10 Jul 2004

By "consistent with SEARCH" I assume you mean you like it because it takes the same parameter as SEARCH, thus making excludetopic mutually independent of its SEARCH or TOPICS context. However, I do not understand what you mean for your usage of the phrase "it is not consistent" for the part "suppress all Web* topics _by default_". It is orthogonal to SimplerDefaults for example. Perhaps you can explain?

I will agree that the problem you allude to (inadvertently hiding all topics starting with Web, e.g. a topic called WebMethods) causes problems, but it extends beyond the scope of localisation.

Short of moving the special topics from WebSpecialtopic to _Specialtopic (e.g. _Statistics) (a motion which I support because it stops the pollution of the users topic name space), I guess a solution would be (yet another) variable explicitly containing the list of special topics to be excluded.

So how about TOPICLISTEXCLUSIONPATTERN = "WebChanges, WebIndex, WebNotify, WebPreferences, WebRss, WebSearch, WebStatistics, WebTopicList"

Finally I suggest recording a feature request for the unsetting of a parameter by setting it to an empty string. It will return.

-- MartinCleaver - 12 Jul 2004

Could someone confirm that the TOPICLISTEXCLUSIONPATTERN would be accepted if I were to code it? Thanks. M.

-- MartinCleaver - 19 Jul 2004

i'd say maybe, but only after you have doccoed the pluginHandlers that Walter rushed in for you.

-- SvenDowideit - 19 Jul 2004

Let me add my support for Martin's suggestion. Having the default web topics show up in the topic list is always a great nuisance.

-- ThomasWeigert - 19 Jul 2004

Live diff:

-- MartinCleaver - 10 Sep 2004

In retrospect, when trying to clean up the menus in TWiki so that the TWiki web appears after the web list in a "help" section, I find myself editing TWiki.WebLeftBar to say:

   * *TWiki Webs*
%WEBLIST{"      * [[$name.%HOMETOPIC%][$name]]" separator=""}%
<div class="twikiLeftBarPersonal" excludetopic="TWiki">
%INCLUDE{"%MAINWEB%.%WIKINAME%LeftBar" warn="<a href=\"%SCRIPTURLPATH%/edit%SCRIPTSUFFIX%/%MAINWEB%/%WIKINAME%LeftBar?templatetopic=%TWIKIWEB%.WebLeftBarPersonalTemplate\">Create</a> personal sidebar"}%

Note the excludetopic should now be excludeweb - any opinions? They share the same underlying code.

-- MartinCleaver - 15 Sep 2004b

Martin, sorry for being off topic but what is this http://mbssrc.com? I mean, I realize that it is a twiki for the Melbourne Business School that you are running. What skin are you using? What is this diff application that you have there?

-- ThomasWeigert - 11 Oct 2004

The diff application you see is the TWikiReleaseTrackerPlugin - the skin is KoalaSkin with the KoalaSkinMBSTheme

Colas told me that he plans to port his nested webs feature to PatternSkin; once he has done so I'll port the MBS theme feature also.

-- MartinCleaver - 11 Oct 2004

Should this patch be Develop?

-- MartinCleaver - 26 Jul 2005

i'm not really sure what it does, in comparison to the already existing excludetopic parameter

see http://develop.twiki.org/~develop/cgi-bin/view/TWiki/TWikiVariables#SEARCH_text_search_content

I guess this topic has become too confusing for me to understand what you are proposing (yes, i am refusing to look at code, as the context switch won't be helpful to the other things i'm doing)

-- SvenDowideit - 26 Jul 2005

Edit | Attach | Watch | Print version | History: r18 < r17 < r16 < r15 < r14 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r18 - 2006-04-29 - SamHasler
  • 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-2017 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.