Help:Templates
From Unofficial BOINC Wiki
Templates provide a mechanism for inserting the same text into multiple pages. Templates can also be used like "macro instructions".
Contents |
[edit] Basic idea
The basic idea is that you can put something in a page like
{{Boilerplate}}
and this will result in the insertion of the contents of the page named "Template:Boilerplate" at that point. You can edit the page Template:Boilerplate like any other wiki page. Changes made to the template page will be applied to any other page which uses that template when those other pages are displayed.
Templates can contain text, or style and formatting information, or both.
[edit] 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.
[edit] 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).

