Line: 1 to 1 | |||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| |||||||||||||||||||||||
Line: 36 to 36 | |||||||||||||||||||||||
| |||||||||||||||||||||||
Changed: | |||||||||||||||||||||||
< < | New Template System by Example | ||||||||||||||||||||||
> > | TWiki Master Template
All common parts are defined in a master template,
Types of TemplateThere are two types of templates:
HTML Page TemplatesTWiki uses HTML template files for all actions like topic view, edit, preview and so on. This allows you to change the look and feel of all pages by editing just some template files.
The template files are in the
Note: Note: TWikiSkins can be defined to overload the standard templates.
Some special variables are used in templates ( especially
Template TopicsTemplate topics define the default text for new topics. There are three types of template topics: All template topics are located in the TWiki web. The WebTopicEditTemplate can be overloaded. The following search order applies when you create a new topic:
Template Topics in ActionHere is an example for creating new topics based on a specific template topic:
Above form asks for a topic name. A hidden input tag of name "templatetopic" specifies the ExampleTopicTemplate as the template topic. Here is the HTML source of the form:
<form name="new" action="%SCRIPTURLPATH%/edit%SCRIPTSUFFIX%/%WEB%/"> * New example topic: <input type="text" name="topic" value="ExampleTopic%SERVERTIME{$year$mo$day}%" size="22"> <input type="hidden" name="templatetopic" value="ExampleTopicTemplate"> <input type="hidden" name="onlywikiname" value="on"> <input type="submit" value="Create"> (date format is YYYYMMDD) </form> The "onlywikiname" parameter enforces WikiWords for topic names.
Note: Use can use the
Templates by Example | ||||||||||||||||||||||
Attached is an example of an oops base template oopsbase.tmpl and a example oops dialog oopstest.tmpl which is based on the base template. NOTE: This isn't the release version, just a quick, simple demo. | |||||||||||||||||||||||
Line: 44 to 119 | |||||||||||||||||||||||
The first line declares the delimiter variable called "sep", used to separate multiple link items. The variable can be called anywhere by writing %TMPL:P{"sep"}% | |||||||||||||||||||||||
Changed: | |||||||||||||||||||||||
< < | |||||||||||||||||||||||
> > | |||||||||||||||||||||||
| |||||||||||||||||||||||
Line: 90 to 165 | |||||||||||||||||||||||
Deleted: | |||||||||||||||||||||||
< < | |||||||||||||||||||||||
Test template oopstest.tmplEach oops template basically just defines some variables and includes the base template that does the layout work. | |||||||||||||||||||||||
Changed: | |||||||||||||||||||||||
< < | |||||||||||||||||||||||
> > | |||||||||||||||||||||||
| |||||||||||||||||||||||
Line: 126 to 200 | |||||||||||||||||||||||
With URL: .../bin/oops/Test/TestTopic2?template=oopstest¶m1=WebHome¶m2=WebNotify | |||||||||||||||||||||||
Changed: | |||||||||||||||||||||||
< < | |||||||||||||||||||||||
> > | |||||||||||||||||||||||
| |||||||||||||||||||||||
Deleted: | |||||||||||||||||||||||
< < | TWiki master template
All common template parts are defined in one master template,
Example: | ||||||||||||||||||||||
Known Issues
| |||||||||||||||||||||||
Changed: | |||||||||||||||||||||||
< < | -- PeterThoeny - 23 Jul 2001 -- MikeMannix - 30 Aug 2001 | ||||||||||||||||||||||
> > | -- PeterThoeny - 23 Jul 2001 -- MikeMannix - 14 Sep 2001 | ||||||||||||||||||||||
|