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