Template:Infobox election/shortname: Difference between revisions

Jump to navigation Jump to search
m (1 revision imported)
m (Updated properly... uhm, hopefully.)
 
Line 1: Line 1:
{{#switch:{{{name|}}}
{{#if:{{{name|}}}
|Other|other|={{{name|}}}
|{{#ifeq:{{{link}}}|no
|#default=
|{{{name}}}
  {{#ifeq:{{{link}}}|no
|{{#ifeq:{{delink|{{{name}}}|wikilinks=target}}|{{{name}}}
    |{{#switch:{{{name}}}
      | Independent | Independents = {{wp|Independent politician|{{{name}}}}}
      | Other | Others = Others
      | [[{{{name}}}|{{#invoke:Political party|fetch|{{{name}}}|shortname}}]]
      }}
     |{{{name}}}
     |{{{name}}}
    |{{#ifexist:Template:{{{name}}}/meta/shortname
  }}
      |[[{{{name}}}|{{Template: {{{name}}}/meta/shortname}}]]
}}
      |{{{name}}}
      }}
  }}
}}<noinclude>
}}<noinclude>
{{documentation|content=
{{documentation|content=
Line 14: Line 16:


== 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>

Latest revision as of 19:32, 28 October 2022