Help:Template
More actions
| This article is heavily focused on providing a brief overview of templates used in the Destiny Wiki. For more advanced information, see Wikipedia:Help:Template. |
| This article is part of a series on |
| Wiki Contribution |
General
|
Tools
|
Miscellaneous
|
The wiki has a variety of templates that help aid user readability, navigability, functionality and aesthetic. This page will serve to attempt to outline all of these categories, as well as templates within them. Any wiki user can create or edit a template, but keep in mind that editing a template will affect how the template appears on all pages that it has been transcluded to.
What is a Template?
A template is reference material that has been transcluded (see Wikipedia:Help:Transclusion for more information on how transclusion works) onto another page for easy repetition of information or functionality. For example, the Template:Meme sidebar allows for easy user navigability to other Memes or Category:Memes (see Wikipedia:Help:Categories for more information on categories) that might be useful to the end user in order to reduce their interaction with otherwise "messy" pages (primarily category pages which some users might find difficult or confusing to utilize.)
How do I use Templates?
Templates are always identified by a set of an opening and closing pair of double curly brackets (i.e. {{ and }}) to indicate the start and stop of the template. Both pairs of brackets are required for the template to function. A full example of how a template could be written is as follows:
{{WIP}}. The WIP Template is used to denote that a page is under heavy writing, restructuring, or is otherwise incomplete and may be difficult to parse if read. When properly typed into a page, it will display as follows:
|
Here you can see that the template strategically uses color, an icon, as well as boldened text to draw the attention of the reader to it before proceeding with the article. It's important to use templates strategically as they may not always be necessary.
Parameters
Un-named Parameters
There is another component to most templates, which are parameters. Parameters allow you to define certain aspects of a given template provided they have been written into the template; for example, the Color Template is used to easily change the color of text (such as on the Flairs article) in order to change the color of different flair names, and has four un-named parameters. Un-named parameters have no assigned word-value and thus must be entered in order as written in the template. The color template for example has the four following parameters that are common in many templates:
Parameter 1
The color of the text. For any template with a color parameter, you can use HTML pre-specified colors, HEX codes (i.e. #a0a, #00aaff, etc.), HSL/HSLA (i.e. hsla(50, 45%, 20%, .2)) Be sure to consider accessibility of selected colors if you do use them, as color-blind users may have difficulty reading certain color combinations, and some users may use non-standard wiki themes (such as the citizen theme), custom wiki themes, or browser plugins that may invert or change the color on the page.
Parameter 2
The color of the highlight. Not as common. Considerations above still apply.
Parameter 3
The size of the highlight. Many templates will let you control the size of an element within it. For example, Template:Color allows you to highlight text, and optionally make the highlight larger, or even obnoxiously large. Be sure to consider the resizing of any elements for cleanness as well as consider display on mobile devices. For size parameters, you can use percentages (i.e. "50%"), pixels, (i.e. "50px") or CSS units like "em", "rem", etc.
Parameter 4
The text. This is one of the most common parameters in any given template, as most templates on the wiki are used to preserve a certain "style" (for example, Template:Mbox is a base template for Template:WIP, Template:Stub, and Template:Expand Section).
Using a template with un-named parameters
Templates with un-named parameters are about as common as templates with named parameters, so it's important to know how they function. Typically a template that is meant to be in-line (as in, in-line with the text and not it's own separate element) will have un-named parameters to reduce bloat so that an editor of a page does not have as difficult of a time viewing it as they would with named parameters (which use up more space.) As discussed above, un-named parameters are entered in order of how they are specified in the template. For this example, we will be looking at Template:Wiki which provides an easy way to link to pages on Wikipedia (as well as visually distinguish it from other external links). The Template is laid out as follows:
{{wiki|1|2|3}}
If we assign what each parameter does to it's number, it will appear as the following:
{{wiki|page name|display text|punctuation}}
This allows us to input some basic information knowing where everything should go, such as:
{{wiki|Destiny (streamer)|Steven Bonell|!}}
Inputting this would produce something in-line, like a link to Steven Bonell!
Some templates also don't require every parameter to be filled, which you could see by inputting something like {{wiki|Hasan Piker||.}} netting a link to Hasan Piker.
(note the the "|" character (referred to as a pipe) for the second and third parameters are still there despite the second parameter being left blank.)
Named Parameters
Named parameters are the other type of parameters. They are similar to un-named parameters, but are required to be specified in the template text in order to be defined. The above section on un-named parameters will mostly apply to named parameters as well, with the added step of defining which parameter you want to identify (in an order of your choosing). For this section, we will explore Template:Blockquote as an example of a template with named parameters. This template has two parameters, the name of the individual ("name") and the text quoted ("quote"), and can be written as follows: {{blockquote|name=Destiny|quote=Whiplash is a 10/10 movie.}} This will provide a large, block style quote with the inputted information, displaying as:
| Whiplash is a 10/10 movie. |
| — Destiny |
Template:Blockquote additionally has optional parameters, so, if you did not want to include a name on the quote, you could leave out the parameter "name" (you could also leave out "quote" but it wouldn't make much sense for this particular scenario), for example {{blockquote|quote=Whiplash is a 10/10 movie.}} will net:
| Whiplash is a 10/10 movie. |
Documentation
The template page should have documentation (created using the Template:Documentation) supporting it to provide what each parameter is, what it controls, as well as when and how to use the template, as well as examples of the template. Some templates may not have documentation due to time constraints, but support with templates can always be provided by reaching out to the author of the template, User:Devonnn, or the #dgg-wiki channel in the Destiny discord.