New Foswiki release 2.1.6 is available with important security fixes.
Sourceforge foswiki email lists being discontinued. Subscribe to the new Foswiki announce and discuss lists at MailingLists

Pass parameters to an INCLUDE

  • Tip Category - Developing Wiki Applications
  • Tip Added By - RichMorin - 29 Sep 2009 - 18:55
  • Extensions Used - None
  • Useful To - Beginners
  • Tip Status - New
  • Related Topics -


You want something like a macro or a user-defined parameterized variable.


You want to write some TML which acts differently, based on how you use it.


TML INCLUDEs work quite nicely as macros. Basically, any named include argument (eg, foo="123") that doesn't match a predefined parameter can be used (eg, ...%foo%...) in the body of the include.

Here is some setup code:

   * [[][%title%]];
     %author%; %imprint%
     %IF{ "defined notes" then="<p>%notes%" }%

Here is the usage code:

%INCLUDE{"Projects/WebIncludes"  section="bl_amz"  imprint="Developer's Library"  isbn="067232685X"
  author="Chris Newman"

Known Uses

Known Limitations

See Also

BestPracticeTipsForm edit

Category Developing Wiki Applications
Topic revision: r1 - 29 Sep 2009, RichMorin - This page was cached on 21 Mar 2018 - 02:59.

The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License