Jump to content

Template:Infobox election/shortname: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
m Protected "Template:Infobox election/shortname": Highly visible template; 10,000+ transclusions ([Edit=Require template editor access] (indefinite) [Move=Require template editor access] (indefinite))
convert to module use, update /doc
Tag: Reverted
Line 4: Line 4:
{{#ifeq:{{{link}}}|no
{{#ifeq:{{{link}}}|no
|{{{name}}}
|{{{name}}}
|{{#ifexist:Template:{{{name}}}/meta/shortname
|[[{{{name}}}|{{#invoke:Political party|fetch|{{{name}}}|shortname}}]]
|[[{{{name}}}|{{Template: {{{name}}}/meta/shortname}}]]
|{{{name}}}
}}
}}
}}
}}<noinclude>
}}<noinclude>
Line 14: Line 11:


== Purpose ==
== Purpose ==
This subtemplate takes two inputs, <code>name</code> and <code>link</code>. If link is set to <code>no</code>, then it returns the value of <code>name</code> verbatim. Otherwise, if the corresponding {{tld|{{{name}}}/meta/shortname}} template exists, it returns <code><nowiki>[[{{{name}}}|shortname]]</nowiki></code> where <code>shortname</code> is the output of the {{tld|{{{name}}}/meta/shortname}} template. If this template does not exist, it returns the value of <code>name</code> verbatim.
This subtemplate takes two inputs, <code>name</code> and <code>link</code>. If link is set to <code>no</code>, then it returns the value of <code>name</code> verbatim. Otherwise, it returns <code><nowiki>[[{{{name}}}|shortname]]</nowiki></code> where <code>shortname</code> is the output of the [[Module:Political party|political party]] module. If the shortname does not exist in the module, it returns the value of <code>name</code> verbatim.
}}</noinclude>
}}</noinclude>

Revision as of 12:52, 25 November 2021