Template:Flaglink/doc: Difference between revisions

From Hattrick
Jump to navigationJump to search
Jhattara (talk | contribs)
Created page with 'This template displays the flag and the name of a country, linked to the main article of that country (flag + country). === Usage === ; Country (mandatory) : Parameter 1 identif…'
 
Jhattara (talk | contribs)
 
(6 intermediate revisions by the same user not shown)
Line 1: Line 1:
This template displays the flag and the name of a country, linked to the main article of that country (flag + country).
This template displays the flag, linked to the main article of that country.


=== Usage ===
=== Usage ===
; Country (mandatory)
; Country (mandatory)
: Parameter 1 identifies the country by '''name''' or '''three-letter code''' ([[ISO 3166-1 alpha-3]])
: Parameter 1 identifies the country by '''name''' or '''three-letter code'''
: Name example: <nowiki>{{flagcountry|</nowiki>'''France'''}} → {{flagcountry|France}}
: Name example: <nowiki>{{flaglink|</nowiki>'''France'''}} → {{flaglink|France}}
: Country code example: <nowiki>{{flagcountry|</nowiki>'''FRA'''}} → {{flagcountry|FRA}}
: Country code example: <nowiki>{{flaglink|</nowiki>'''FRA'''}} → {{flaglink|FRA}}
 
; Variant flag image (optional)
: Parameter 2 is used to display a different version of the flag. 
: Example:  <nowiki>{{flagcountry|France|</nowiki>'''free'''}} → {{flagcountry|France|free}}.  In this example, the historical flag for [[Free France]] (1940-1945) is identified by the second parameter of "free".  The list of flag variants is specific for each country.<!-- DOCUMENTED WHERE? -->
 
; Link text (optional)
: Use the '''name=''' parameter to change the link text. 
: Example: <nowiki>{{flagcountry|France|</nowiki>'''name=C'est la France'''}} → {{flagcountry|France|name=C'est la France}}


; Size (optional)
; Size (optional)
: Use the '''size=''' parameter to change the size from the default.   
: Use the '''size=''' parameter to change the size from the default.   
: Example: <nowiki>{{flagcountry|France|</nowiki>'''size=40px'''}} → {{flagcountry|France|size=40px}}.
: Example: <nowiki>{{flaglink|France|</nowiki>'''size=40px'''}} → {{flaglink|France|size=40px}}.


===Implementation===
===Implementation===
This template uses the data templates listed under [[:category:country data templates]], which contain the data '''what''' to display (Example: [[template:country data France]]) and the formatter [[template:country flagcountry2]], which contains the logic '''how''' to display the country data.
This template uses the data templates listed under [[:category:country data templates]], which contain the data '''what''' to display (Example: [[template:country data France]]) and the formatter [[template:country flaglink2]], which contains the logic '''how''' to display the country data.


* <nowiki>{{flagcountry|France}}</nowiki> = {{flagcountry|France}} — uses [[template:country data France]]
* <nowiki>{{flaglink|France}}</nowiki> = {{flaglink|France}} — uses [[template:country data France]]
* <nowiki>{{flagcountry|FRA}}</nowiki> = {{flagcountry|FRA}} — uses [[template:country data FRA]], which is a redirect to [[template:country data France]]
* <nowiki>{{flaglink|FRA}}</nowiki> = {{flaglink|FRA}} — uses [[template:country data FRA]], which is a redirect to [[template:country data France]]


=== Related templates ===
=== Related templates ===
* [[template:flagicon]] — to display the flag alone
* [[template:flagicon]] — similar to [[template:flaglink|flaglink]], but links either nowhere or to another page
** <nowiki>{{flagicon|France}}</nowiki> = {{flagicon|France}}
** <nowiki>{{flagicon|France}}</nowiki> = {{flagicon|France}}
** <nowiki>{{flagicon|FRA}}</nowiki> = {{flagicon|FRA}}
** <nowiki>{{flagicon|FRA}}</nowiki> = {{flagicon|FRA}}
* [[template:flag]] — similar to [[template:flagcountry|flagcountry]], but uses the input parameter as the display text for the link
* [[template:flag]] — to display the flag with the name of the country
** <nowiki>{{flag|France}}</nowiki> = {{flag|France}}
** <nowiki>{{flag|France}}</nowiki> = {{flag|France}}
** <nowiki>{{flag|FRA}}</nowiki> = {{flag|FRA}}
** <nowiki>{{flag|FRA}}</nowiki> = {{flag|FRA}}
Line 37: Line 29:
[[Category:Flag template system|{{PAGENAME}}]]
[[Category:Flag template system|{{PAGENAME}}]]
</includeonly>
</includeonly>
<noinclude>[[Category:Template documentation]]</noinclude>

Latest revision as of 17:39, 5 May 2010

This template displays the flag, linked to the main article of that country.

Usage

Country (mandatory)
Parameter 1 identifies the country by name or three-letter code
Name example: {{flaglink|France}} → France
Country code example: {{flaglink|FRA}} → France
Size (optional)
Use the size= parameter to change the size from the default.
Example: {{flaglink|France|size=40px}} → France.

Implementation

This template uses the data templates listed under category:country data templates, which contain the data what to display (Example: template:country data France) and the formatter template:country flaglink2, which contains the logic how to display the country data.

Related templates