TemplateDoc:Acronym

From Halopedia, the Halo wiki

Revision as of 19:04, June 4, 2020 by Superintendent (talk | contribs) (Inserting TemplateDoc notice)
This is a template documentation page!
You cannot edit the associated template from here. To do so, please see Template:Acronym instead!

Acronym templates

Generating titles and names

Links

Sanitising specific acronym types

Checking acronym existence

Usage

This template is used to sanitise Halopedia acronyms before they are used in other templates. It does not guarantee that an acronym is valid, as the correct response to an invalid acronym will vary between templates that call this one. However, it guarantees that what it returns will be in lower case and that, if it was a valid acronym, it will have been replaced with the primary acronym for that topic. For instance, HTFoR will have been replaced with tfor. This allows template pages to only have to consider the primary acronym cases, while still providing support for the secondary acronyms.

Usually, if no acronym match is found, the template will simply return exactly what was passed to it, albeit in lower case. However, by setting the NoPassthrough flag, the template can be made to output nothing if the acronym does not exist.

Parameters

Field Name Field Aliases Optional or Required? Description Example
1 (Unnamed field) - Required The acronym to sanitise. TFoR
Passthrough - Optional Determines whether or not to pass the original argument through if no acronym match was found. If this flag is set - to anything at all - passthrough will be disabled. Otherwise, passthrough is enabled by default. no

Error states

This template has no error states.

Examples

Here are some examples of what the template will output, when used:

Wiki markup Result
"{{Acronym|CE}}" "ce"
"{{Acronym|H1X}}" "ce"
"{{Acronym|banana}}" "banana"
"{{Acronym|CE|NoPassthrough=yes}}" "ce"
"{{Acronym|H1X|NoPassthrough=yes}}" "ce"
"{{Acronym|banana|NoPassthrough=yes}}" ""