create new tag
, view all tags
The code in handleIncludeFile ends with the lines:
    my $text = &readFile( $fileName );

    $fileName =~ s/\/([^\/]*)\/([^\/]*)(\.txt)$/$1/go;
    if( $3 ) {
        # identified "/Web/TopicName.txt" filename
        my $incWeb = $1;
        # Change all "TopicName" to "Web.TopicName" in text
        $text =~ s/([\*\s][\(\-\*\s]*)([A-Z]+[a-z]+(?:[A-Z]+[a-zA-Z0-9]*))/$1$incWeb\.$2/go;
        $text =~ s/%WEB%/$incWeb/go;
    return $text;

That means that the tag %WEB% is replaced with the origin web of the topic.

It seems to me that semantic of the %WEB% variable can be different in the original topic and in the topic that includes it.

It would be very useful for simplifying multiple web management to use direct topic inclusion for the base topics of several webs. E.g. in webs Web1 Web2 ... Webn we put a topic WebSearch that contains only:

This way, by changing in a single (access-protected) place the WebSearch topic the TWikiManager can update the pages of several webs.

In some sense, this is a MetaTemplate inclusion mechanism. Properly coupled with site/web/user preferences we get a tool very easy to edit/administer.

I propose that:

  • we add a new variable %INCLUDINGWEB% that is equal to the web cited in the url of the view/edit/preview... command

-- AndreaSterbini - 01 Sep 2000

By default it should stay as it is, e.g. %INCLUDE%ed topics should point to topics in the included web. However, for more advanced setup like you describe we need to point to the including web. How about a new parameter in %INCLUDE% like this:

   %INCLUDE{"%TWIKIWEB%.WebSearch" includingweb="on"}%

The question is how to handle nested includes with includingweb="on" .

-- PeterThoeny - 03 Sep 2000

It's probably more flexible for the user that wants to mix both references to the origin web and references to the including web if we define also the INCLUDINGWEB variable.

About your last question ... what if the %WEB% variable is replaced only after all inclusions are done?

-- AndreaSterbini - 04 Sep 2000

INCLUDINGWEB and BASEWEB are implemented in Dakar. Marking this as MergedToCore.

-- RafaelAlvarez - 13 Mar 2006

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