Help:Use templates
Contents
Templates
For TangoWiki exist multiple templates, which can be embedded in articles and other pages. Templates allow the input of text with its display already being determined by the template behind it. Templates are especially useful for infoboxes, tables and other content with factual character.
Embedding of templates has many advantages:
- uniformly display of information on comparable pages
- simplification of creating new pages (less Wiki syntax, less code)
- simpler adaption of more than one page at the same time, respectively, their display
- simple storage of information for semantic browsing, creation of semantic templates (no change for embedding)
Use templates
All templates in TangoWiki are collected in the Category:TangoWiki templates. The article templates in there can directly be used in articles. Classic templates are always stored in the namespace "Template".
On the respective template page there is the code for embedding documented. This code can be copied and embedded into articles. Then the particular parameters are filled with right information. After saving the page the template will be shown pre-formatted on the page
Generally, templates are embedded with the code {{Template name}}
(template name within 2 curly brackets each). In more complex templates with variable parameters, the curly brackets still remain at the beginning and end of the code.
Parameters & values
In some templates there are defined parameters with variable values to be filled. These parameters should be shortly described on the template page, to simplify filling-in.
Some parameters are mandatory, which means, that the field will show even with empty values. Some parameters are optional, so the field can stay empty and the empty field won't show.
Tip: It is recommended to embed the entire code into the page, even if some parameters cannot be filled in right away. This makes it easier for other users to detect and complete missing values.
Article templates
There are a few article templates you can use during writing. They are usually in the syntax {{Templatename|Parameter value}}
. Use the template of your choice ("template name") and change the "parameter value" for your desired text.
Note
For making use of the template Note, include {{Note|Note text}}
in your text to produce:
Info
For making use of the template Note-info, include {{Note-info|This helps you a lot!}}
in your text to produce:
In a nutshell
For making use of the template Summary text, include {{Note-nutshell|This is the page in one sentence. Actually, two.}}
in your text to produce:
Example: Infobox Song
For articles about songs there is an infobox on the right side, which can be embedded with the Template:Infobox Song. For this, the embedding code is copied from the template page and added on top of the source code on the article page. The variable parameters (after the vertical lines) are filled with values.
Code:
{{ Infobox Song | Filename = | Caption = | Writer1 = | Writer2 = | Composer1 = | Composer2 = | Year of composition = | Genre = }}
Filled-in example (data from Lucienne):
{{ Infobox Song | Filename = BIAGI_2209_A.jpg | Caption = Shellac | Writer1 = Jorge Fuentes | Writer2 = | Composer1 = Domingo Rullo | Composer2 = | Year of composition = 1946 | Genre = Tango }}
Check on the page Lucienne how this infobox will look like.
Modifications to the values can be made in the source code of the article. Changes to the infobox itself have to be made in the source code of the infobox template.
Help
For questions about using templates contact the creator or editor of the template page or of an article, in which the template has already been used. On which pages a template is used, you can view on the template page in the left sidebar under "Toolbox" > "What links here".