Useful Templates: Difference between revisions
Created page with "This page exists to document useful wiki templates you may wish to use in your pages. This is not intended to be an exhaustive list of all templates, only the ones that are likely to be used directly by writers in wiki pages. = Basic Template Usage = To use a template in a page, you have to switch to "Source Editing" mode, which is the dropdown at the pencil-icon in the top-right corner of the edit box. Basic template usage has the name of the template surrounded in d..." |
No edit summary |
||
| Line 83: | Line 83: | ||
Giant planets ({{hlist|class=inline|[[Valaya|V]]|[[Infernum|I]]|[[Edith|E]]}}). | Giant planets ({{hlist|class=inline|[[Valaya|V]]|[[Infernum|I]]|[[Edith|E]]}}). | ||
</div> | </div> | ||
== Legend == | |||
Useful for map or diagram legens, this template inserts a single line of text labeled with a colored box. | |||
=== Example Usage === | |||
<nowiki>{{legend|#7EA6E0|Valaya}}</nowiki> | |||
=== Example Output === | |||
{{legend|#7EA6E0|Valaya}} | |||
== Infobox == | == Infobox == | ||
Revision as of 15:05, 13 May 2025
This page exists to document useful wiki templates you may wish to use in your pages. This is not intended to be an exhaustive list of all templates, only the ones that are likely to be used directly by writers in wiki pages.
Basic Template Usage
To use a template in a page, you have to switch to "Source Editing" mode, which is the dropdown at the pencil-icon in the top-right corner of the edit box.
Basic template usage has the name of the template surrounded in double curly brackets on either side:
{{Template Name}}
(Template names may contain spaces)
A lot of templates take arguments, which may be optional, and may have to be of a specific type (i.e. String vs. Number).
An example of a parametrized template would be:
{{Template Name|First Parameter|3.14159}}
If a template has a lot of parameters, it is possible (or even required) to refer to them by name to avoid confusion. For instance, imagine a template with parameters called "name", "title" and "description". It could then be used like this:
{{Template Name
| name = Test
| title = Hello there!
| description = CHIRP!
}}
Templates
Plainlist
This template provides a WCAG/ISO-standards-compliant accessible alternative to regular lists as they can be created in the editor. List items may be plain text, formatted text, or links.
Example Usage
{{plainlist|
* [[Valaya]]
* [[Magnus]]
* [[Edith]]
* [[Frost]]
* '''BOLD TEXT'''
}}
Example Output
Bulleted List
Similar to the previous template, but puts bullet points before each list items.
Example Usage
{{bulleted list|[[Valaya]]|[[Infernum]]|[[Edith]]|[[Frost]]|'''BOLD TEXT'''}}
Example Output
Ordered List
Similar to the previous template, but it numbers the entries instead of using bullet points. The parameter "type" determines how the numbering is done. The default is decimal. For a full list, see the documentation at MDN Web Docs.
If the list has to start with a number other than 1, use the "start" parameter and specify the starting numeral.
Example Usages
{{ordered list|[[Valaya]]|[[Infernum]]|[[Edith]]|[[Frost]]|'''BOLD TEXT'''}}
{{ordered list|type=lower-roman|[[Valaya]]|[[Infernum]]|[[Edith]]|[[Frost]]|'''BOLD TEXT'''}}
Example Outputs
Horizontal List
This template creates responsive horizontal lists. It is recommended to use this template rather than placing links manually. List items may be plain text, formatted text, or links.
Example Usage
Giant planets ({{hlist|class=inline|[[Valaya|V]]|[[Infernum|I]]|[[Edith|E]]}}).
Example Output
Legend
Useful for map or diagram legens, this template inserts a single line of text labeled with a colored box.
Example Usage
{{legend|#7EA6E0|Valaya}}
Example Output
Infobox
This template provides a generic infobox. Infobox templates for more specific purposes may exist, or may be added to the wiki in the future, so check first if a box for what you need exists before using this template.
A infobox consists of a title, header, optional subheader followed by a number of header, label and content/datapoints. All parameters are optional, only add what you need.
The infobox may contain a header image after the text headers and sub-headers.
Example Usage
{{Infobox
|name = Test Infobox
|title = Test Infobox
|above = Header Text
|subheader = First subheader
|subheader2 = Second subheader
|image = [[File:Example.png|200px]]
|caption = This is the caption shown below the image
|headerstyle = background: #ff8833;
|labelstyle = background: #fcaf79;
|header1 = The first section
|label1 = a
|data2 = Content of the first section
|header3 = The second section
|label4 = A Label
|data4 = Labeled content
|belowstyle = background: #fcaf79;
|below = Below text to finish things off
}}
Template Tricks
This section is intended to list some common ways to combine templates that our editors have found, which you are free to copy-paste and make use of in your own pages.
Image with List
[[File:Example.png|thumb|100px|{{bulleted list |one |two |three}}]]

- one
- two
- three
Nested Lists
{{ordered list
|{{hlist|horizontal|list|here}}
|Sub-list Title<br>{{bulleted list|a|sub|list}}
|Normal List Item
}}
- horizontal
- list
- here
- Sub-list Title
- a
- sub
- list
- Normal List Item
Clear
By default, text will flow around certain templated elements, such as infoboxes. However, this may be undesired past a certain point, such as when starting a new section of the article. The clear template forces a break, and all text following it to be put after all templates before the clear. Usage:
{{clear}}
