Changes

1,858 bytes added ,  10:38, 30 December 2016
no edit summary
{{Documentation subpage}}
<!-- PLEASE ADD CATEGORIES AND INTERWIKIS AT THE BOTTOM OF THIS PAGE -->

=== Usage ===
This is a meta-template that is not intended to be transcluded directly from the main article space. It can be used to construct other templates that need to extract the {{para|alias}} value from the specified <code>[[:Category:Country data templates|country_data]]</code> structure, so that customized wikilinks can be constructed. For example, {{tnull|getalias|USA}} → "{{getalias|USA}}".

Different parameter values can be extracted using the second unnamed parameter. Use <kbd>shortname</kbd> as a second parameter to retrieve the {{para|shortname alias}} value if desired. For example, {{tnull|getalias|IRL}} → "{{getalias|IRL}}", but {{tnull|getalias|IRL|shortname}} → "{{getalias|IRL|shortname}}". To extract the flag image name ({{para|flag alias}}), use <kbd>flag</kbd> as second parameter: {{tnull|getalias|CHN|flag}} &rarr; "{{getalias|CHN|flag}}". The output defaults to the {{para|alias}} value if the desired {{para|''xxx'' alias}} is undefined in the target template.

A third parameter can specify the variant; for example, <code><nowiki>[[File:{{getalias|United States|flag|1912}}|22px]]</nowiki></code> &rarr; [[Image:{{getalias|United States|flag|1912}}|22px]] returns the image defined as {{para|flag alias-1912}} in {{tl|Country data United States}}. The variant parameter can also be used to extract the link used with military and sports templates (e.g. {{tl|army}}, {{tl|fb}}): {{tnull|getalias|UK|link|army}} &rarr; {{getalias|UK|link|army}}.

=== See also ===
* {{tl|getalias2}}, a more general version that can extract {{para|size}} and {{para|border}} as well
* {{tl|ISO 3166 name}}

<includeonly>
<!-- CATEGORIES AND INTERWIKIS HERE, THANKS -->
[[Category:Flag template system|{{PAGENAME}}]]

</includeonly>
Anonymous user