Difference between revisions of "Template:Infobox election/shortname"

From blackwiki
Jump to navigation Jump to search
imported>Frietjes
imported>MusikAnimal
m (Protected "Template:Infobox election/shortname": Highly visible template; 10,000+ transclusions ([Edit=Require template editor access] (indefinite) [Move=Require template editor access] (indefinite)))
 
(4 intermediate revisions by one other user not shown)
Line 1: Line 1:
{{#ifeq:{{{link}}}|no
+
{{#switch:{{{name|}}}
  |{{{name}}}
+
|Other|other|={{{name|}}}
   |{{#ifexist:Template:{{{name}}}/meta/shortname
+
|#default=
    |[[{{{name}}}|{{Template: {{{name}}}/meta/shortname}}]]
+
   {{#ifeq:{{{link}}}|no
 
     |{{{name}}}
 
     |{{{name}}}
  }}
+
    |{{#ifexist:Template:{{{name}}}/meta/shortname
 +
      |[[{{{name}}}|{{Template: {{{name}}}/meta/shortname}}]]
 +
      |{{{name}}}
 +
      }}
 +
  }}
 
}}<noinclude>
 
}}<noinclude>
 
{{documentation|content=
 
{{documentation|content=
Line 10: Line 14:
  
 
== Purpose ==
 
== Purpose ==
This subtemplate takes two inputs, <code>party</code> and <code>link</code>.  If link is set to <code>no</code>, then it returns the value of <code>party</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>party</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, 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.  
 
}}</noinclude>
 
}}</noinclude>

Latest revision as of 16:52, 9 October 2017

Template documentation

This is a subtemplate of {{Infobox election}}, it should not be used directly.

Purpose

This subtemplate takes two inputs, name and link. If link is set to no, then it returns the value of name verbatim. Otherwise, if the corresponding {{{{{name}}}/meta/shortname}} template exists, it returns [[{{{name}}}|shortname]] where shortname is the output of the {{{{{name}}}/meta/shortname}} template. If this template does not exist, it returns the value of name verbatim.