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 someone answered one of your questions - please remember to edit the page and set the status to answered. The status selector is 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:
Edit | Attach | Watch | Print version | History: r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r3 - 2007-06-08 - TWikiGuest
 
  • 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-2026 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.