Template:Acronym/Novel: Difference between revisions

From Halopedia, the Halo wiki

m (→‎top: Moving page, replaced: {{Documentation → {{Doc/Template)
No edit summary
Line 98: Line 98:
| sor     
| sor     
| hsor  = sor
| hsor  = sor
<!-- ### Halo: Outcasts ### -->
| out   
| hout  = out
<!-- ### Halo: Epitaph ### -->
| epi   
| hepi  = epi
<!-- ####### DEFAULT ####### -->
<!-- ####### DEFAULT ####### -->
| #default = {{#if:{{{NoPassthrough|}}}||{{lc:{{{1|}}}}}}}
| #default = {{#if:{{{NoPassthrough|}}}||{{lc:{{{1|}}}}}}}
}}</includeonly><noinclude>{{Doc/Template}} [[Category:Acronym templates]]</noinclude>
}}</includeonly><noinclude>{{Doc/Template}} [[Category:Acronym templates]]</noinclude>

Revision as of 11:47, June 8, 2023

vde
Template Documentation

Usage

This template is used to sanitise Halopedia novel 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 parameter, 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
NoPassthrough - 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. yes
Strict - Optional Determines whether or not the test should strictly adhere to the standard acronym defined on this page. If this is set (to any value whatsoever), it will only check against the standard acronyms. Otherwise, it may check against non-standard acronyms, that are specific to the novels.

IMPORTANT: Non-standard acronyms are permitted to clash with acronyms in other categories! For instance, with the strict flag disabled, this template treats SS and HSS as valid acronyms for Halo: Silent Storm, even though they're assigned to the game Halo: Spartan Strike according to the standard acronyms. Always set strict to enabled if your template deals with other types of media as well as novels.

yes

Error states

This template has no error states.

Examples

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

Wiki markup Result
*Strict w/ passthrough: "{{Acronym/Novel|TFoR|Strict=yes}}"
*Not strict w/ passthrough: "{{Acronym/Novel|TFoR}}"
*Strict w/o passthrough: "{{Acronym/Novel|TFoR|Strict=yes|NoPassthrough=yes}}"
*Not strict w/o passthrough: "{{Acronym/Novel|TFoR|NoPassthrough=yes}}"
  • Strict w/ passthrough: "tfor"
  • Not strict w/ passthrough: "tfor"
  • Strict w/o passthrough: "tfor"
  • Not strict w/o passthrough: "tfor"
*Strict w/ passthrough: "{{Acronym/Novel|HTFoR|Strict=yes}}"
*Not strict w/ passthrough: "{{Acronym/Novel|HTFoR}}"
*Strict w/o passthrough: "{{Acronym/Novel|HTFoR|Strict=yes|NoPassthrough=yes}}"
*Not strict w/o passthrough: "{{Acronym/Novel|HTFoR|NoPassthrough=yes}}"
  • Strict w/ passthrough: "tfor"
  • Not strict w/ passthrough: "tfor"
  • Strict w/o passthrough: "tfor"
  • Not strict w/o passthrough: "tfor"
*Strict w/ passthrough: "{{Acronym/Novel|FoR|Strict=yes}}"
*Not strict w/ passthrough: "{{Acronym/Novel|FoR}}"
*Strict w/o passthrough: "{{Acronym/Novel|FoR|Strict=yes|NoPassthrough=yes}}"
*Not strict w/o passthrough: "{{Acronym/Novel|FoR|NoPassthrough=yes}}"
  • Strict w/ passthrough: "for"
  • Not strict w/ passthrough: "tfor"
  • Strict w/o passthrough: ""
  • Not strict w/o passthrough: "tfor"
*Strict w/ passthrough: "{{Acronym/Novel|banana|Strict=yes}}"
*Not strict w/ passthrough: "{{Acronym/Novel|banana}}"
*Strict w/o passthrough: "{{Acronym/Novel|banana|Strict=yes|NoPassthrough=yes}}"
*Not strict w/o passthrough: "{{Acronym/Novel|banana|NoPassthrough=yes}}"
  • Strict w/ passthrough: "banana"
  • Not strict w/ passthrough: "banana"
  • Strict w/o passthrough: ""
  • Not strict w/o passthrough: ""