Tags:
create new tag
view all tags

Question

Hi.

I would like my WebLeftBar to contain a list of anchors derived from the headings in another topic - i.e. the %TOC% of another topic. I've tried adding the following to my WebLeftBar :

%TOC{"MyContents"}%

This works perfectly when I view all topics except the MyContents topic - I get a nice list of all the headings, which link to the correct place. However, when I view the MyContents topic, I get the following message in the WebLeftBar : "TOC: No TOC in "GNBWeb.ByTools"" - even though the there is a TOC gnereated in the main page - it just doesn't exist in the WebLeftBar.

I guess the PatternSkin is interfering with the TOC generation in some way - does anyone have any clues how to work around this ?

Cheers,

Steve.

Environment

TWiki version: TWikiRelease02Sep2004
TWiki plugins: DefaultPlugin, EmptyPlugin, InterwikiPlugin
Server OS: RH 7.3
Web server: Apache 1.3.26
Perl version: 5.6.0
Client OS: Solairs, MSWindows XP SP2
Web Browser: Firefox 1.0.4, Mozilla 1.7
Categories: Skin

-- SteveJonesST - 09 Jun 2005

Answer

see TocOfBaseTopicInIncludedPage

-- WillNorris - 09 Jun 2005

Thanks for the pointer. Your patch won't fit with Cairo, which seems to have the following in TWiki.pm :

   my $result  = "";
    my $line  = "";
    my $level = "";
    my @list  = ();
     
    if( "$web.$topicname" eq "$_[2].$_[1]" ) {
        # use text from parameter
        @list = split( /\n/, $_[0] );

    } else {
        # read text from file
        if ( ! &TWiki::Store::topicExists( $web, $topicname ) ) {  
            return showError( "TOC: Cannot find topic \"$web.$topicname\"" );
        }
        my $t = TWiki::Store::readWebTopic( $web, $topicname );
        $t =~ s/.*?%STARTINCLUDE%//s;
        $t =~ s/%STOPINCLUDE%.*//s;
        @list = split( /\n/, handleCommonTags( $t, $topicname, $web ) );
    }

I am comforatble with PERL, but nervous about modifying TWiki.pm on a busy, live intranet.

Can anyone suggest a way to patch this for Cairo ?

-- SteveJonesST - 10 Jun 2005

Quick note on updating a live system:

  • Install two TWiki engines on the same server, call it Beta and Prod (for production)
  • Configure Apache to access both engines with different base URL for cgi-bin
  • Configure Beta TWiki to point to Prod for data and pub
  • Keep Beta and Prod engine in sync
  • When you want to install a new Plugin or make a small change to the engine do that in Beta
  • Once tested (functionality, bugs, performance) you can sync the changed files into production. You can do that on the fly, users don't realize the change.

-- PeterThoeny - 10 Jun 2005

Edit | Attach | Watch | Print version | History: r5 < r4 < r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r5 - 2005-07-03 - 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.