From 3af77e1afbcdaa273cca76c396470d2d2d57d9ab Mon Sep 17 00:00:00 2001 From: MikeMannix Date: Fri, 7 Sep 2001 10:07:14 +0000 Subject: none --- TWiki/TWikiTemplates.mdwn | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'TWiki/TWikiTemplates.mdwn') diff --git a/TWiki/TWikiTemplates.mdwn b/TWiki/TWikiTemplates.mdwn index fdfb3d71..2537761a 100644 --- a/TWiki/TWikiTemplates.mdwn +++ b/TWiki/TWikiTemplates.mdwn @@ -6,23 +6,23 @@ see also for ref: orig [[TWikiTemplatingSystem]] %TOC% %STARTINCLUDE% -## TWiki Template System +# TWiki Template System _Define the templates used to render all HTML pages displayed in TWiki_ -### Overview +# Overview We have a need for more advanced template handling. As [[Main/JohnTalintyre]] pointed out in [[CommonHeaderFooterTemplate]] it makes sense to separate the header and footer into one file so that it can be easily altered (or even overloaded by a skin). Also the oops dialog messages are all identical except for a few variables like heading, and so on. Using external modules like the [[TemplateToolkit]] would be one way to go, but this will add a lot of baggage to TWiki. -### Needs of the TWiki templating system +## Needs of the TWiki templating system * Separate common parts into one (or more) base template file(s) and include that from other template files like `view.tmpl`. * Define common variables like a "|" separator in the base template and use them in other template files * Define variable text in templates (i.e. `view.tmpl`) and pass them to the base template -### Functional Spec +## Functional Spec I tried to define a simple but powerful solution that can be extended over time. Here we go: @@ -41,11 +41,11 @@ I tried to define a simple but powerful solution that can be extended over time. * Templates and skins work transparently and interchangeably. You could for example define a new skin just for the header & footer and keep the other template files unchanged. * **_Note:_** The template directive work only for templates, they do not get processed in topic text. -### Examples +## Examples 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. This is not the version that will go into the release, it is just a quick hack. -##### Base template oopsbase.tmpl +#### Base template oopsbase.tmpl 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"\}% @@ -95,7 +95,7 @@ The first line declares the delimiter variable called "sep", used to separate mu -##### Test template oopstest.tmpl +#### Test template oopstest.tmpl Each oops template basically just defines some variables and includes the base template that does the layout work. @@ -124,7 +124,7 @@ Test =topicaction=: -##### Sample screen shot of oopstest.tmpl +#### Sample screen shot of oopstest.tmpl With URL: **.../bin/oops/Test/TestTopic2?template=oopstest&param1=WebHome&param2=WebNotify** @@ -134,7 +134,7 @@ With URL: **.../bin/oops/Test/TestTopic2?template=oopstest&param1=WebH -### Comments and feedback +## Comments and feedback * The itching factor to put this into the upcoming release is to easy the pending converstion of the templates into XHTML format and to have a more flexible solution for templates and skins. * Is the terminology OK? -- cgit v1.2.3