Nice TWiki > TWiki > TWikiTemplates (r1.17 vs. r1.18) TWiki webs:
Dev | Doc | Main | TWiki | Sandbox
TWiki . { Welcome | Register | Changes | Topics | Index | Search | Go }
 <<O>>  Difference Topic TWikiTemplates (r1.18 - 01 Feb 2003 - PeterThoeny?)
Added:
>
>

Edit Template Topics and Variable Expansion

The following variables get expanded when a user creates a new topic based on a template topic:

Variable: Description:
%DATE% Current date, e.g. 23 Oct 2017
%WIKIUSERNAME% User name, e.g. Main.TWikiGuest
%URLPARAM{"name"}% Value of a named URL parameter
%NOP% A no-operation variable that gets removed. Useful to prevent a SEARCH from hitting an edit template topic; also useful to escape a variable like %URLPARAM%NOP%{...}%
%NOP{ ... }% A no-operation text that gets removed. Useful to write-protect an edit template topic, but not the topics based this template topic. See notes below. Example:
%NOP{
   * Set ALLOWTOPICCHANGE = Main.TWikiAdminGroup
}%

Notes:

  • Unlike other variables, %NOP{ ... }% can span multiple lines.
  • The scan for the closing }% pattern is "non-greedy", that is, it stops at the first occurance. That means, you need to escape variables with parameters located inside %NOP{ ... }%: Insert a %NOP% between } and %. Silly example: %NOP{ %GMTIME{"$year"}%NOP%% }%.

All other variables are unchanged, e.g. are carried over "as is" into the new topic.

Changed:
<
<

-- PeterThoeny - 23 Jul 2001

>
>

-- PeterThoeny - 01 Feb 2003


Topic TWikiTemplates . { View | Diffs | r1.18 | > | r1.17 | > | r1.16 | More }
Revision r1.17 - 08 Jan 2003 - 07:13 GMT - PeterThoeny?
Revision r1.18 - 01 Feb 2003 - 12:46 GMT - PeterThoeny?
Copyright © 1999-2003 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback.