Tags:
create new tag
, view all tags

INCLUDEPARAMS{<list of parameter definitions>} - used in macro topics

  • Syntax: %INCLUDEPARAMS{<list of parameter names with default values and documentations string>}%
  • What happens:
    1. When viewed directly:
      • The defined paramters are shown in a table listed with default values and short description.
    2. When used as macro (i.e. shown via %INCLUDE{...}% in another topic)
      • The defined paramters are (again) shown in a table, now the actual value for the paramers are also shown.
      • The paramers will be used with default value if the parameter is not submitted by the %INCLUDE{...}%
  • Supported paramters: None (no fixed name parameters are supported).
  • Syntax for <list of parameter names with default values and documentations string> is shown by example:
          %INCLUDEPARAMS{
             debug = "no      ::doc:: =yes= or =no="                    - Show debug information in =%INCLUDINGTOPIC%="
             size  = "medium  ::doc:: =small= , =medium= or =large=     - Size of brunch"
             egg   = "boiled  ::doc:: =boiled=, =srambled= or =porched= - How do you want your egg?"
          }% 
    Notes:
    • ::doc:: is used as delimeter between default value on the left side and documentation on the right side (initial and trailing blanks are removed)
    • You cannot have a lineshift in the middle of a parameter definition
    • You must escape ", i.e. write \" to put a " inside a parameter definition
    • You cannot have an }% inside, use }<nop>% if you need to display }% as part of documentation
  • Examples:
    • See IncludeTopicsAndWebPages#UseAsMacro
      Disclaimer: The above link does not function until some changes have been made to TWiki docs, please read Changes to be made to TWiki doc
    • Output is put inside a <div class='twikiDefaultIncludeParamTable'> ...</div> , to disable output in %INCLUDINGTOPIC% you may...
      1. either Dynamically set css style div.twikiDefaultIncludeParamTable {display: none} (for instance based on %debug% parameter and %IF{...}% )
      2. or Place %INCLUDEPARAMS{...}% before your %STARTINCLUDE%
  • Related: IF, INCLUDE, STARTINCLUDE
Topic revision: r3 - 27 Oct 2006 - 23:00:12 - NielsKoldso
 
This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback