| |
TWikiTemplates 22 - 25 Apr 2004 - Main.PeterThoeny
|
|
META TOPICPARENT | name="WebHome" |
| |
| |
< < |
%WIKIUSERNAME% | User name, e.g. Main.TWikiGuest |
| > > |
%USERNAME% | Login name, e.g. jsmith |
%WIKINAME% | WikiName of user, e.g. JohnSmith |
%WIKIUSERNAME% | User name, e.g. Main.JohnSmith |
| |
%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 }% |
| |
- A drawback of referring to a master template is that you can only test a template from within TWiki, where the include variables are resolved. In the previous system, each template was a structurally complete HTML document with a
.tmpl filename extension - it contained unresolved %VARIABLES% , but could still be previewed directly in a browser.
| |
< < | -- TWiki:Main.PeterThoeny - 30 Dec 2004
| > > | -- TWiki:Main.PeterThoeny - 25 Apr 2004
| | -- TWiki:Main.MikeMannix - 14 Sep 2001
-- TWiki:Main.DavidLeBlanc - 11 Mar 2002 | |
> > | | |
META FILEATTACHMENT | attr="h" comment="Example of oopstest.tmpl rendered" date="1026977240" name="testscreen.gif" path="C:\Data\Temp\testscreen.gif" size="9566" user="PeterThoeny" version="1.2" |
META TOPICMOVED | by="MikeMannix" date="1000277381" from="TWiki.TWikiTemplateSystem" to="TWiki.TWikiTemplates" |
|
|
TWikiTemplates 20 - 16 Dec 2003 - Main.PeterThoeny
|
|
META TOPICPARENT | name="WebHome" |
| | </form>
| |
< < | The onlywikiname parameter enforces WikiWords for topic names. The topicparent parameter sets the topic parent to the topic where the form is located. | > > | The edit scipt understands the following parameters, typically supplied by HTML input fields:
Parameter: | Description: |
topic | Name of topic to create. Can be set in a text field, or is set programmatically (e.g. with a sequential number) |
onlywikiname | If set, TWiki will complain if the topic name is not a WikiWord |
templatetopic | The name of the template topic, e.g. topic used to copy the initial content |
topicparent | Sets the parent topic |
TopicClassification | Assuming the template topic has a form with a field called "TopicClassification", it will set the value of the field |
anyname | Any parameter can passed to the new topic; if the template topic contains %URLPARAM{"anyname"}% , it will be replaced by its value |
| | TIP: You can use the %WIKIUSERNAME% and %DATE% variables in your topic templates to include the signature of the person creating a new topic. The variables are expanded into fixed text when a new topic is created. The standard signature is:
-- %WIKIUSERNAME% - %DATE% | |
- A drawback of referring to a master template is that you can only test a template from within TWiki, where the include variables are resolved. In the previous system, each template was a structurally complete HTML document with a
.tmpl filename extension - it contained unresolved %VARIABLES% , but could still be previewed directly in a browser.
| |
< < | -- PeterThoeny - 01 Feb 2003
-- MikeMannix? - 14 Sep 2001
-- TWiki:Main/DavidLeBlanc - 11 Mar 2002 | > > | -- TWiki:Main.PeterThoeny - 16 Dec 2003
-- TWiki:Main.MikeMannix - 14 Sep 2001
-- TWiki:Main.DavidLeBlanc - 11 Mar 2002 | |
META FILEATTACHMENT | attr="h" comment="Example of oopstest.tmpl rendered" date="1026977240" name="testscreen.gif" path="C:\Data\Temp\testscreen.gif" size="9566" user="PeterThoeny" version="1.2" |
META TOPICMOVED | by="MikeMannix" date="1000277381" from="TWiki.TWikiTemplateSystem" to="TWiki.TWikiTemplates" |
|
|
TWikiTemplates 18 - 01 Feb 2003 - Main.PeterThoeny
|
|
META TOPICPARENT | name="WebHome" |
| |
- WebTopicEditTemplate in the current web
- WebTopicEditTemplate in the TWiki web
| |
> > | 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. 01 Dec 2024 |
%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. | | Template Topics in Action
Here is an example for creating new topics based on a specific template topic: | |
- A drawback of referring to a master template is that you can only test a template from within TWiki, where the include variables are resolved. In the previous system, each template was a structurally complete HTML document with a
.tmpl filename extension - it contained unresolved %VARIABLES% , but could still be previewed directly in a browser.
| |
< < | -- PeterThoeny - 23 Jul 2001
| > > | -- PeterThoeny - 01 Feb 2003
| | -- MikeMannix? - 14 Sep 2001
-- TWiki:Main/DavidLeBlanc - 11 Mar 2002
META FILEATTACHMENT | attr="h" comment="Example of oopstest.tmpl rendered" date="1026977240" name="testscreen.gif" path="C:\Data\Temp\testscreen.gif" size="9566" user="PeterThoeny" version="1.2" |
|
|
Revision 22 | r22 - 25 Apr 2004 - 07:07:38 - PeterThoeny? |
Revision 21 | r21 - 31 Dec 2003 - 07:29:57 - PeterThoeny? |
Revision 20 | r20 - 16 Dec 2003 - 08:19:00 - PeterThoeny? |
Revision 19 | r19 - 02 Apr 2003 - 08:24:51 - PeterThoeny? |
Revision 18 | r18 - 01 Feb 2003 - 12:46:00 - PeterThoeny? |
Revision 17 | r17 - 08 Jan 2003 - 07:13:12 - PeterThoeny? |
|
|
This site is powered by the TWiki collaboration platform. All material on this collaboration platform is the property of the contributing authors. All material marked as authored by Eben Moglen is available under the license terms CC-BY-SA version 4.
|
|
| |