Help:Templates

From BOINC

Templates provide a mechanism for inserting the same text into multiple pages. Templates can also be used like "macro instructions".

First the pie is prepared and baked. ,

Templates with parameters

Templates can be constructed so that they take parameters. Used this way, they essentially become macro instructions.

For example, say you have several wiki pages describing stations in a large data acquisition system. A template called "Station" could be used to create a summary box on each page, with template parameters used to specify the latitude and longitude of the station (in that order). Then each page would have a line like

  {{Station|+41.6877|-73.8937}}

In the template page named "Template:Station" one would refer to the latitude as {{{1}}} and the longitude as {{{2}}}. That is, you surround the argument number with three levels of curly brackets. The parameter values would then be inserted into the text at those positions.


It is also possible to give parameters names, instead of referring to them by position, and it is possible to give them default values. See the MediaWiki manual page for details.

Other namespaces

The template syntax can be used to include any other page from the wiki. You just have to specify the namespace (or just ":" for the Main namespace). For example, you can insert into any page the "Quick Help" page from the "Help" namespace by adding to that page

 {{Help:Quick Help}}

where you want that box to appear (it's designed to float to the right side of the page).

See Also