Help:Template programming

From TDWG Terms Wiki
Jump to: navigation, search

A detailed overview for template programming is given on MediaWiki’s help page ( One important thing to remember is the equal sign (=) because it always denotes and separates a template parameter. Example:

{{Display fabulous URL|}}

… will recognise the unnamed first parameter automatically (i.e. the first position after the template name {{Display fabulous URL|…}} will be used inside the template as parameter {{{1}}}); BUT the following does not work so:

{{Display fabulous URL|}}

The Wiki parser will search for the equal sign and here the template parameter will be mistaken: it will be the yellow marked part in this template call! In such a case you have to program it explicitly to use parameter 1, like so, to get it working:

{{Display fabulous URL|1=}}

You can start programming a template with the following form (it contains a prefilled basic content and sections; see template: TemplateError/preload/en):