Tags:
create new tag
, view all tags

Question

I would like to be able to define TWiki preferences with parameters (macros). For example, defining:

%HEAD{chapter 1}%

to render as:

<B><I>chapter 1</I></B>

Where chapter 1 can be any text

As far as I can tell there is no 'easy' way to accomplish this in TWiki. Is this correct?

If so, I will have to implement my own macros in twiki's sourcecode. This shouldn't be too much of a problem; I am familier with Perl. Can anybody give some pointers as to where in the source it is best to implement this. Which file, and which function?

Environment

TWiki version: TWikiRelease04x00x05
TWiki plugins: DefaultPlugin, EmptyPlugin, InterwikiPlugin
Server OS: Windows XP
Web server: TinyWeb/1.94
Perl version: 5.8.6, build 2005.02 (ActiveState)
Client OS: Windows XP
Web Browser: Seamonley
Categories: Missing functionality

-- TWikiGuest - 05 Jun 2007

Answer

ALERT! If you answer a question - or have a question you asked answered by someone - please remember to edit the page and set the status to answered. The status is in a drop-down list below the edit box.

Preferences do not support parameters at this time. However, you can use parameterized include. This is not well documented, but see VarINCLUDE and IncludedTopicUsedAsMacro.

-- PeterThoeny - 06 Jun 2007

See sample at SnazzyRoundedCornersContrib.

-- PeterThoeny - 06 Jun 2007

Thank you for your answer. After looking at how to write plugins, and thinking about it a little I decided to write a plugin which contains some shortcuts.

-- TWikiGuest - 08 Jun 2007

 
Change status to:
Topic revision: r3 - 2007-06-08 - TWikiGuest
 
Twitter Delicious Facebook Digg Google Bookmarks E-mail LinkedIn Reddit StumbleUpon    
  • Download TWiki
TWiki logo Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2012 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.