Tags:
create new tag
, view all tags

Feature Proposal: Allow multiple STARTINCLUDE and STOPINCLUDE tags

Motivation

It would be usefull to modularize a page, giving the ability to name STARTINCLUDE tags so other pages can INCLUDE them by name.

Description

By giving STARTINCLUDE and STOPINCLUDE the ability to associate user defined names, any page using an INCLUDE could call in specific portions of a page by calling that name as well. The syntax would be straight forward: STARTINCLUDE{ThisName} Stuff goes here. STOPINCLUDE{ThisName} INCLUDE{Main.PageName#ThisName}

This would allow stacking of stuff to be included.

-- CraigMonson - 13 Dec 2005

Impact and Available Solutions

Note: Patch is attached as http://twiki.org/p/pub/Codev/MultipleStartincludeStopinclude/twiki-foo-bar-patch.diff. The patch is against the TWikiAlphaRelease of 15 Feb 2004.

Documentation

If necessary, user documentation of new features introduced by this proposal.

Examples

This is a page with a list of stuff. It can be broken up into different lists and should allow other pages the ability to include different portions of the page.
---+++++ PageName
%STARTINCLUDE{MyFullList}%
%STARTINCLUDE{MyPrimaryList}%
   * List item 1
   * List item 2
   * List item 3
%STOPINCLUDE{MyPrimaryList}%
%STARTINCLUDE{MySecondaryList}%
   * List item 4
   * List item 5
   * List item 6
%STOPINCLUDE{MySecondaryList}%
%STOPINCLUDE{MyFullList}%

Any portion of the list can be INCLUDEd by using:

%INCLUDE{PageName#MyFullList}%
or
%INCLUDE{PageName#MyPrimaryList}%

Implementation

Any comments on how the feature is implemented or could be improved


Discussion:

The upcoming DakarRelease has a function which is almost identical to your feature request: Instead of having named %STARTINCLUDE% and %STOPINCLUDE% it offers named %SECTION{...}% and %ENDSECTION% tags.

The %INCLUDE% directive is being extended by a new section operand which, like your #anchor, selects one of the named sections.

The solution in DakarRelease does not have named %ENDSECTION% directives, so there's only one level of nesting (!

Warning: Can't find topic ""."" without a section takes everything between %STARTINCLUDE% and %STOPINCLUDE%, and %INCLUDE{}% with a section takes the named component).

See http://develop.twiki.org/~develop/cgi-bin/view/TWiki/TWikiVariables#VarSECTION for a description of the syntax.

-- HaraldJoerg - 14 Dec 2005

Oh, it has an %ENDSECTION% directive: http://develop.twiki.org/~develop/cgi-bin/view/TWiki/TWikiVariables#VarENDSECTION The DakarRelease already includes exactly the feature that has been proposed here.

-- MichaelDaum - 14 Dec 2005

Sweet! Thanks for your incredibly quick response!

-- CraigMonson - 14 Dec 2005

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