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. 2025-05-10 |
%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. |