create new tag
, view all tags
We have % TOPIC%, % BASETOPIC% % INCLUDINGTOPIC%. Is this how these should be assigned at the
      include web2.topic2
          include web3.topic3
              include web1.topic4
          include topic5
       include topic 6

Variable Value
TOPIC web1.topic4
BASETOPIC web1.topic1

If this is true, how does a plugin get the name of the TOPIC variable? If this isn't true do we need an % INCLUDEDTOPIC% variable??

This came up in the context of CommentPlugin. If a page with a comment block is % INCLUDEed% or view in a BookView search the button that installs the comment has an action that is set to topic1.

From the comment in Plugins.pm:

sub commonTagsHandler
    # Called by sub handleCommonTags, after %INCLUDE:"..."%
#    my( $text, $topic, $theWeb ) = @_;
    unshift @_, ( 'commonTagsHandler' );
    $_[0] =~ s/% PLUGINDESCRIPTIONS%/&handlePluginDescription()/geo;
    $_[0] =~ s/% ACTIVATEDPLUGINS%/&handleActivatedPlugins()/geo;

it looks like there is no way for the plugin to get the name of the current topic since the including has already occured and I think from my reading of the code the % TOPIC% and other variables have already been substituted.

The Comment plugin uses:

$text="\n\n<form name=\"comment\" action=\"$TWiki::scriptUrlPath/savecomment
$TWiki::scriptSuffix/$web/$topic\" method=\"post\">\n";

to create the action. Any ideas on what this should be to get the value of % TOPIC% as I show in the table above?

In place of that, is there anyway of telling if a % COMMENT% variable is comming from an included file rather than from the topic1 file? At least in that case the code could simply not render the comment in the base page.

My comments in Plugins.CommentPluginDev has some additional musings.

-- JohnRouillard - 10 Dec 2001

This would be easier to track from a plugin's perspective if the including could happen just after informing the plugins with a preIncludeHandler hook - as I've just added to the MorePluginHooks page...

-- TWikiGuest - 03 Feb 2002

Edit | Attach | Watch | Print version | History: r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r3 - 2003-09-06 - MichaelSparks
  • 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-2018 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.