Template:Flaglink: Difference between revisions
Jump to navigation
Jump to search
(create) |
(update for faction tags) |
||
Line 1: | Line 1: | ||
<includeonly>{{#switch:{{{format|}}}|large|block=<div>}}<!-- | <includeonly>{{#switch:{{{format|}}}|large|block=<div>}}<!-- | ||
--div adds spacing, see common.css-- | --div adds spacing, see common.css-- | ||
-->[[File:{{#if:{{{file|}}}|{{{file}}}|{{{1}}} {{#if:{{{variant|}}}|flag {{{variant}}}|flag}}.{{#if:{{{ext|}}}|{{{ext}}}|png}}}}|{{#switch:{{{format|}}}|large|block=150|small|inline|#default=20}}px|{{{1}}} flag]]<!-- | -->[[File:{{#if:{{{file|}}}|{{{file}}}|{{{1}}} {{#if:{{{variant|}}}|flag {{{variant}}}|{{#switch:{{{format}}}|tag|torn=tag|#default=flag}}}}.{{#if:{{{ext|}}}|{{{ext}}}|png}}}}|{{#switch:{{{format|}}}|large|block=150|tag|torn=25|small|inline|#default=20}}px|{{{1}}} flag]]<!-- | ||
--link spacing-- | --link spacing-- | ||
-->{{#switch:{{{format|}}}|large|block=<br />|small|inline|#default= }}{{#iferror:{{abbrgame|{{{2}}}}}|{{error|invalid game specified}}|{{gamepage|{{#if:{{{leader|}}}|{{{leader}}}|{{{1}}}}}|{{#if:{{{3|}}}|{{{3}}}|}}|game={{abbrgame|{{{2}}}|full}}|p={{#if:{{{leader|}}}||x}}}}}}{{#switch:{{{format|}}}|large|block=</div>|small|inline|#default=<br />}}<!-- | -->{{#switch:{{{format|}}}|large|block=<br />|small|inline|#default= }}{{#iferror:{{abbrgame|{{{2}}}}}|{{error|invalid game specified}}|{{gamepage|{{#if:{{{leader|}}}|{{{leader}}}|{{{1}}}}}|{{#if:{{{3|}}}|{{{3}}}|}}|game={{abbrgame|{{{2}}}|full}}|p={{#if:{{{leader|}}}||x}}}}}}{{#switch:{{{format|}}}|large|block=</div>|small|inline|#default=<br />}}<!-- | ||
--warnings-- | --warnings-- | ||
-->{{#ifexpr:{{#ifeq:{{{ext|}}}|png|1|0}} or {{#ifeq:{{{file|}}}|{{{1}}} flag.png|1|0}}|[[Category:Pages with redundant template parameters]]|}}</includeonly><noinclude>{{documentation}}</noinclude> | -->{{#ifexpr:{{#ifeq:{{{ext|}}}|png|1|0}} or {{#ifeq:{{{file|}}}|{{{1}}} {{#switch:{{{format}}}|tag|torn=tag|#default=flag}}.png|1|0}}|[[Category:Pages with redundant template parameters]]|}}</includeonly><noinclude>{{documentation}}</noinclude> |
Revision as of 09:28, 28 December 2021
Documentation [edit]
This template is used to conveniently insert a group's flag and a link to their page (or a related individual), formatted to a standard layout. This is primarily used within
{{War infobox}}
and {{Treaty infobox}}
(for blocs), and can be extended for other uses.
The parameters you need to use depend on how closely the flag's file name matches the file naming guidelines.
Parameters
- first unnamed parameter - the name of the group, spelled out.
- second unnamed parameter - the related game to link to (passed to
{{gamepage}}
through{{abbrgame}}
). - third unnamed parameter (optional) - what to display for the link; defaults to the full group name.
- leader (optional) - this is used to change the link target to an individual instead of the group, e.g. for war commanders. Provide the person's name here.
- ext (optional) - use this if you need to change only the file extension of the file, e.g.
|ext=jpg
. - variant (optional) - use this to specify an alternate version of the flag, such as a game-specific one. Whatever you put here will be inserted at the end of the file name, before the extension.
- file (optional) - use this if you need to override the standard file name fully. Specify the name and extension.
- format - the layout to use. Currently supported: "large" or "block" will display the flag at a larger size with the link below it, while "small" or "inline" will display a small flag with the link next to it; "tag" will display at 25px to support animated faction tags in Torn. Small is the default and does not need to be specified.
Examples
This section is a stub - it only covers the very basics of its subject. More information should be added to make the section informative and useful. If no more information is available, the section should be considered for merging or removal.
If you can correct the issue, please edit the page to do so, then remove this notice.
If you can correct the issue, please edit the page to do so, then remove this notice.
The above documentation is transcluded from Template:Flaglink/doc.