Line: 1 to 1 | ||||||||
---|---|---|---|---|---|---|---|---|
TWiki Templates | ||||||||
Line: 59 to 59 | ||||||||
When the "inactive" context is set, then this will expand the "link_inactive" template; otherwise it will expand the "link_active" template. See IfStatements for details of supported context identifiers. | ||||||||
Added: | ||||||||
> > | ||||||||
Finding TemplatesThe master templates shipped with a twiki release are stored in the twiki/templates directory. | ||||||||
Line: 116 to 117 | ||||||||
Tip: If you want to override existing templates, without having to worry that your changes will get overwritten by the next TWiki update, change the {TemplatePath} so that another directory, such as the %USERSWEB% appears at the front. You can then put your own templates into that directory or web and these will override the standard templates. (Note that such will increase the lookup time for templates by searching your directory first.) | ||||||||
Added: | ||||||||
> > | ||||||||
TMPL:INCLUDE recursion for piecewise customisation, or mixing in new featuresIf there is recursion 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. | ||||||||
Line: 128 to 130 | ||||||||
The default {TemplatePath} will not give you the desired result if you put these statements in the topic Thisweb.YourlocalSkinViewTemplate . The default {TemplatePath} will resolve the request to the template/view.pattern.tmpl , before it gets to the Thisweb.YourlocalSkinViewTemplate resolution. You can make it work by prefixing the {TemplatePath} with: $web.YourlocalSkin$nameTemplate . | ||||||||
Added: | ||||||||
> > | ||||||||
Default master templatetwiki.tmpl is the default master template. It defines the following sections. | ||||||||
Line: 158 to 161 | ||||||||
| ||||||||
Added: | ||||||||
> > | ||||||||
Variable ExpansionTWikiVariables located in template topics get expanded as follows when a new topic is created. | ||||||||
Line: 244 to 248 | ||||||||
| ||||||||
Added: | ||||||||
> > | Characters after AUTOINC<n> are preserved, but are not taken into account when calculating the next increment. Use this to create topic names that have a unique identifier (serial number) and a descriptive text.
Example:
| |||||||
Example link to create a new topic:[[%SCRIPTURLPATH{edit}%/%WEB%/BugIDAUTOINC00001?templatetopic=BugTemplate;topicparent=%TOPIC%;t=%SERVERTIME{"$day$hour$min$sec"}%][Create new item]] | ||||||||
Added: | ||||||||
> > | ||||||||
Template Topics in ActionHere is an example for creating new topics (in the Sandbox web) based on a specific template topic and form: | ||||||||
Line: 288 to 300 | ||||||||
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% | ||||||||
Added: | ||||||||
> > | ||||||||
Using Absolute vs Relative URLs in TemplatesWhen you use TWikiVariables such as %PUBURL% and %PUBURLPATH% in templates you should be aware that using %PUBURL% instead of %PUBURLPATH% puts absolute URLs in the produced HTML. This means that when a user saves a TWiki page in HTML and emails the file to someone outside a company firewall, the receiver has a severe problem viewing it. It is therefore recommended always to use the %PUBURLPATH% to refer to images, CSS, Javascript files etc so links become relative. This way browsers just give up right away and show a usable html file. |