Line: 1 to 1 | ||||||||
---|---|---|---|---|---|---|---|---|
On this page:
TWiki Templates | ||||||||
Line: 14 to 14 | ||||||||
All three types of template use the TWiki template system. | ||||||||
Added: | ||||||||
> > | ![]() ![]() | |||||||
The TWiki Template SystemTemplates are plain text with embedded template directives that tell TWiki how to compose blocks of text together to create something new. | ||||||||
Line: 24 to 26 | ||||||||
| ||||||||
Changed: | ||||||||
< < |
| |||||||
> > |
| |||||||
| ||||||||
Line: 64 to 66 | ||||||||
| ||||||||
Changed: | ||||||||
< < |
| |||||||
> > |
| |||||||
| ||||||||
Changed: | ||||||||
< < |
| |||||||
> > |
| |||||||
Legend:
| ||||||||
Line: 95 to 97 | ||||||||
view and edit respectively. The template search order is as specified above. | ||||||||
Added: | ||||||||
> > | TMPL:INCLUDE recusion for piecewise customisation, or mixing in new featuresIf there is recusion in the TMPL:INCLUDE chain (eg twiki.classic.tmpl contains%TMPL:INCLUDE{"twiki"}% , the templating system will include the next twiki.SKIN in the skin path.
For example, to create a customisation of pattern skin, where you only want to over-ride the breadcrumbs for the view script, you can create only a view.yourlocal.tmpl:
%TMPL:INCLUDE{"view"}% %TMPL:DEF{"breadcrumb"}% We don't want any crumbs %TMPL:END%and then set SKIN=yourlocal,pattern | |||||||
Master TemplatesMaster templates use the block definition directives (%TMPL:DEF and %TMPL:END% ) to define common sections that appear in two or more other templates. twiki.tmpl is the default master template.
| ||||||||
Line: 143 to 155 | ||||||||
| ||||||||
Changed: | ||||||||
< < |
| |||||||
> > |
| |||||||
| ||||||||
Line: 203 to 215 | ||||||||
Automatically Generated Topicname | ||||||||
Changed: | ||||||||
< < | If you want to make a TWiki application where you need automatically generated unique topicnames, you can use 10 X's in the edit / save URL, and they will be replaced on topic save with a count value. For example, BugIDXXXXXXXXXX will result in topics named BugID0, BugID1, BugID2 etc. | |||||||
> > | For TWiki application it is useful to automatically generate unique topicnames, such as BugID0001, BugID0002, etc. You can add AUTOINC<n> to the topic name in the edit and save scripts, it gets replaced with an auto-incremented number on topic save. <n> is a number starting from 0, and may include leading zeros. Leading zeros are used to zero-pad numbers so that auto-incremented topic names can sort properly. Deleted topics are not re-used to ensure uniqueness of topic names. That is, the auto-incremented number is always higher than the existing ones, even if there are gaps in the number sequence.
Examples:
| |||||||
Example link to create a new topic: | ||||||||
Changed: | ||||||||
< < | Create new item= | |||||||
> > | Create new item= | |||||||
Master Templates by Example | ||||||||
Line: 219 to 236 | ||||||||
The first line declares a delimiter variable called "sep", used to separate multiple link items. The variable can be called anywhere by writing %TMPL:P{"sep"}%
| ||||||||
Deleted: | ||||||||
< < | ||||||||
%TMPL:DEF{"sep"}% | %TMPL:END% <html> | ||||||||
Line: 260 to 275 | ||||||||
</table> </body> | ||||||||
Deleted: | ||||||||
< < | ||||||||
Test template oopstest.tmpl | ||||||||
Line: 269 to 282 | ||||||||
Each oops template basically just defines some variables and includes the base template that does the layout work. | ||||||||
Deleted: | ||||||||
< < | ||||||||
%TMPL:DEF{"titleaction"}% (test =titleaction=) %TMPL:END% %TMPL:DEF{"webaction"}% test =webaction= %TMPL:END% | ||||||||
Line: 291 to 302 | ||||||||
[[%TWIKIWEB%.TWikiRegistration][Register]] %TMPL:END% %TMPL:INCLUDE{"oopsbase"}% | ||||||||
Deleted: | ||||||||
< < | ||||||||
Sample screen shot of oopstest.tmplWith URL:.../bin/oops/Sandbox/TestTopic2?template=oopstest¶m1=WebHome¶m2=WebNotify | ||||||||
Changed: | ||||||||
< < | ||||||||
> > | ![]() | |||||||
Related Topics: TWikiSkins, DeveloperDocumentationCategory, AdminDocumentationCategory |