Help:Template
- Navigation
- Account
- Edit
- Page Management
- Blocks templates personal data
- Standard data
- Embed pages
- Templates programming
- Template documentation
- TemplateData
- Lua
- Template playground
- Templates restrictions
- FAQ
- Index - Help from A to Z
- All Help Pages
- Glossary
A template is a page that facilitates the integration of commonly used elements in other pages after the Transklusionsprinzip. Templates belong to the blocks. In the simplest case, this is a boilerplate text block which can be pasted on another page. In principle, all sides namespaces ( except Special ) was used as a template ( transcluded ) are. Using the Template namespace, however, is preferable for templates to be used in articles in general.
Frequently templates also include the ability to insert variable data bind a graphic elements and use an elementary programming. The integration of personal data, infoboxes, geocoding and navigation bars can be realized in this way, for example.
- 6.1 Detailed documentation on a lower
- 6.2 Categorization
No topics rings
Use templates
To use a simple template in an article, there are three options:
Conditional integration of source blocks
The following tags should only be used in pages that are integrated as a template:
Example
The following code:
Documenting text ...
Category: Template: linkbox
- With the integration { { template name | Bilderwunsch.svg | class = " hintergrundfarbe5 " | ← Example }}
Category: Main Category
Insert Parameter and use
Often should appear in a template content, but the change from page to page, such as a signature or the individual of the image on the Commons in the Template Name: NowCommons. This is achieved with parameters.
If a template named "Template: Title 1", contains the following text
If a parameter is subsequently inserted into an existing template, you may use the articles to be amended accordingly. Failure to do so is either the default value of the parameter used or the change has no impact on the product.
Define default parameter value
One can define a parameter so that no value must be specified for it when using the template. Without this information then takes a previously defined value use. In a construct like { { { title | { { PAGENAME }} }} }, the value of the parameter title, if specified, output, otherwise the name of the page on which the template is included with this construct. These constructs do not burden the server as strong as pre-defined parameter values. See also meta: Help: default parameters.
Important:
The parameter value must not be empty. with
It does not work. It must
. loud
If a default value in also
Be used, it must be in the template
. stand
Problem: Bullets
- If you want to bullet (* or #), as at the beginning of this line, one thing is to use as a parameter value, a new line should be started in the template before the parameter, as for example in the Template: Infobox Film at the parameters { { { DS }} } is the case for performers.
Problem: equality characters in parameter values
The remedy for this undesirable interpretation is that prefixing the parameter value of the numeric index of the parameter and another equal sign. Then, as desired interpreted that the parameter value does not begin until after the ( added ) first equals sign, and this prefix index refers unambiguously the target parameter for the value. The counting of parameters begins with this one the first parameter after the template name.
After following unnamed parameters must also be numbered, as the automatic counting does not consider the explicit numbering, ie at { { template name | first value | 2 = second value | value} } third second value would be replaced by third value.
In the regular text, in which the equal sign has no syntactic significance, the equal sign can be masked by =.
Problem: special characters in parameter values
If the character just appear only in the displayed text or in a URL, a replacement by an HTML entity is the easiest way. URLs can also optionally in URL encoding may be used.
Vertical bar
Table elements
Since the "|" character is used to separate parameters, it may not occur even in parameter values. In order to receive a working table, the following auxiliary templates are to be used:
Larger parts of the table can also be outsourced to an underside of the document, which incorporated there. If that is not practical, if necessary HTML (
Brackets
Problem: Generic masculine
In the generic masculine job titles must not be used continuously. Instead, two parameters for the male and female form can be created and evaluated together. For details, see Help: Infobox / gender.
Purpose
They should not be used as:
Document templates
Templates that are used in normal articles should be as simple designed purpose and application are immediately understandable. In any case, a description of their function is needed. This can be done in the noinclude section of the template page. With frequently involved templates but the function description should better be on a separate page; can this then use the Template: Documentation noinclude section of the page template be referenced. A change in the template page itself causes namely, that all dependent pages to be generated when a new call, rather than to be able to load them from the cache. Current server load should be avoided. However, the above consideration is only relevant if it is to be expected revisions to the documentation without changing function; However, the outsourcing of documentation improved without this clarity.
Detailed documentation on a lower
For detailed documentation, a side of the document is.
For the systematics of the template should: documentation are used.
This provides that the function of the template is described on a lower / document the template page.
The contents of the bottom will appear when viewing the template page.
The Template: Documentation is included by
Categorization
When using the Template: Documentation may be large amounts of metadata, including categories, are outsourced to a bottom.
Assists with special properties are in the appropriate branch of the category: Template: classified by property. Examples would be templates, sort the items automatically in a category, or those with coordinates integration.
Test templates
Templates can " expand Templates" on the special page will be tested, see Help: Template # programming and testing changes to templates with complex dependencies among specialized: template playground (Description Help: Template playground ).
Forward templates
Even with templates forwarding is possible and preferable to a redundant copy of the template. Here, both the name of the forwarding and the forwarding destination of the namespace " Template: " prepend.