Useful Templates: Difference between revisions
No edit summary |
No edit summary |
||
| Line 162: | Line 162: | ||
{{convert|0.021|AU|km|abbr=on}} | {{convert|0.021|AU|km|abbr=on}} | ||
== Format number == | |||
Formats a numeric value to be more readable. Can also automatically generate formatting for scientific notation. Can also attach unit symbols. | |||
=== Examples === | |||
<nowiki>{{Val|123456.78901|fmt=commas}}</nowiki> | |||
<nowiki>{{Val|23.3|0.1}}</nowiki> | |||
<nowiki>{{Val|2.3|e=3}}</nowiki> | |||
<nowiki>{{val|12.34|u=deg}}</nowiki> | |||
<nowiki>{{Val|2.3|0.1|e=3|u=km}}</nowiki> | |||
=== Example Outputs === | |||
{{Val|123456.78901|fmt=commas}} | |||
{{Val|23.3|0.1}} | |||
{{Val|2.3|e=3}} | |||
{{val|12.34|u=deg}} | |||
{{Val|2.3|0.1|e=3|u=km}} | |||
== Infobox == | == Infobox == | ||
Latest revision as of 12:45, 28 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
Disclaimer: Unofficial
Inserts a disclaimer stating that the current page is not yet official lore. Including this template is required on pages that have not yet been approved by lorekeepers. Please use the template for this in case the wording of the disclaimer needs to be updated in the future.
Usage
{{Unofficial}}
Output
Currently unofficial lore, and in progress.
Disclaimer: WiP
Inserts a disclaimer stating that the current page is still being worked on. It usually always accompanies the "Unofficial" disclaimer. There is one required parameter, which is a link to a thread on the project discord server where the topics of the page may be discussed.
Example Usage
{{DiscordLink|https://discord.com/channels/1300333648519888926/1326470053566353458}}
Output
This page is WiP, you can contribute to its writing by discussing in its thread
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 legends, this template inserts a single line of text labeled with a colored box.
Example Usage
{{legend|#7EA6E0|Valaya}}
Example Output
Number to Word
Automatically converts a number into its written-out representation.
Example Usages
{{number to word|5}}
{{number to word|1524968}}
{{number to word|3000000}}
Example Outputs
five
one million five hundred twenty-four thousand nine hundred and sixty-eight
three million
Convert Units
This template automatically converts between units of measurement and can convert multiple values at once. Both the value before and after the conversion will be shown.
Example Usages
{{convert|2|km|mi}}
{{convert|2|-|5|km|mi|abbr=on}}
{{convert|1|kg|lb|abbr=on}}
{{convert|8|cm|in|frac=4}}
{{convert|0.021|AU|km|abbr=on}}
Example Outputs
2 kilometres (1.2 mi)
2–5 km (1.2–3.1 mi)
1 kg (2.2 lb)
8 centimetres (3+1⁄4 in)
0.021 AU (3,100,000 km)
Format number
Formats a numeric value to be more readable. Can also automatically generate formatting for scientific notation. Can also attach unit symbols.
Examples
{{Val|123456.78901|fmt=commas}}
{{Val|23.3|0.1}}
{{Val|2.3|e=3}}
{{val|12.34|u=deg}}
{{Val|2.3|0.1|e=3|u=km}}
Example Outputs
123,456.78901
23.3±0.1
2.3×103
12.34°
(2.3±0.1)×103 km
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
}}
Planet Infobox
A kind of Infobox optimized for celestial bodies.
| Orbital characteristics | |
|---|---|
| 0.02555 ± 0.00017 AU (3,822,200 ± 25,432 km) | |
| 1.21987089 ± 0.00000015 days (105,396.845 ± 0.013 s; 29.2769014 ± 3.6×10−6 h) | |
| Inclination | 87.67±1.81° |
| Semi-amplitude | 0.59 km/s (1,300 mph) |
| Star | HD 15082 |
| Physical characteristics | |
| 1.497±0.095 RJ | |
| Mass | 2.81±0.53 MJ |
| Albedo | 0.369±0.050 |
| Temperature | 2,710 ± 50 K (2,440 ± 50.0 °C; 4,420 ± 90.0 °F) |
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}}
