01.12.2012 Views

7 Components: the Function Pages - Developers

7 Components: the Function Pages - Developers

7 Components: the Function Pages - Developers

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Templates<br />

Standard<br />

template<br />

Tab. 16.3<br />

244<br />

��<br />

��<br />

��<br />

offers no templates. Thus, it is primarily suited to topics that are only<br />

available for viewing.<br />

Therefore, an all-around solution can only be offered by writing<br />

your own templates. You can find templates on <strong>the</strong> server in <strong>the</strong> directory<br />

twiki/templates. They all follow <strong>the</strong> same name convention:<br />

scriptname.skinname.tmpl<br />

For scripts for which now templates have been allocated in <strong>the</strong> current<br />

skin, standard templates are employed, so that you do not necessarily<br />

have to generate all templates. You can write normal HTML<br />

code in <strong>the</strong> template files, but also use certain variables.<br />

The system is divided into two levels. On one hand, <strong>the</strong>re is <strong>the</strong><br />

standard template twiki.tmpl. It defines elements that o<strong>the</strong>r templates<br />

can access. A few of <strong>the</strong>se predefined elements are already visible in<br />

Tab. 16.3:<br />

Name Content<br />

sep element separator.<br />

htmldoctype Standardized area.<br />

standardheader Standard layout header.<br />

simpleheader Simplified header of <strong>the</strong> standard layout,<br />

e.g. for <strong>the</strong> Edit and Attach script.<br />

standardfooter Standard layout footer.<br />

oops Error message skeleton.<br />

You can integrate <strong>the</strong>se elements using <strong>the</strong> command<br />

%TMPL:P{"variablename"}%<br />

If you wish to adopt entire swapped out files, you can do so with <strong>the</strong><br />

following code:<br />

%TMPL:INCLUDE{"filename"}%<br />

The extension.tmpl can be left off. As in <strong>the</strong> case of <strong>the</strong> o<strong>the</strong>r templates,<br />

<strong>the</strong> standard master template is replaced when <strong>the</strong>re is a file<br />

twiki.[skinname].tmpl that matches <strong>the</strong> skin. In this master template,<br />

you of course have <strong>the</strong> possibility of defining a few elements:<br />

%TMPL:DEF{"elementname"}%<br />

elementtext<br />

%TMPL:END%<br />

16 Designing a TWiki

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!