Template:Alias: Difference between revisions

mNo edit summary
mNo edit summary
 
(8 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{#ifeq:{{{u}}}|1|{{{NAME}}}|{{#ifeq:{{{STAFF}}}|1|<span style="color:gold;">{{#tip-text:{{{NAME}}}|Also known as:<br>{{{ALIASES}}}}}</span>|{{#tip-text:{{{NAME}}}|Also known as:<br>{{{ALIASES}}}}}<nowiki/>}}<nowiki/>}}
<noinclude>
<noinclude>
  <pre><nowiki>
  <pre><nowiki>
{{Alias|NAME=Test|ALIASES=Test200<br>Test300}}
{{Alias|U={{{U}}}|NAME=Test|ALIASES=Test200<br>Test300}}
{{Alias|NAME=Test|ALIASES=Test200<br>Test300|STAFF=1}}</nowiki></pre>
{{Alias|U={{{U}}}|NAME=Test|ALIASES=Test200<br>Test300|STAFF=1}}</nowiki></pre>


This template allows for easy creation of name aliases.
This template allows for easy creation of name aliases.
Line 15: Line 13:
* ALIASES: all the aliases as a <nowiki><br></nowiki>-separated list
* ALIASES: all the aliases as a <nowiki><br></nowiki>-separated list
* STAFF: renders the name yellow. For [[Tennis Staff]], who are historically always yellow on forums, discord, etc. If true, set to 1.
* STAFF: renders the name yellow. For [[Tennis Staff]], who are historically always yellow on forums, discord, etc. If true, set to 1.
* u: ONLY WHEN IN PAGES. Disable recoloring/tooltips, for special rendering situations like matchboxes. If true, set to 1.
* U: Disable recoloring/tooltips, for special rendering situations like matchboxes. If true, set to 1. ONLY CHANGE ON ACTUAL TEMPLATE CALLS, NOT WHEN BUILDING!


=Usage=
=Usage=
In ''almost'' all cases, just call the template the name without any parameters, so for example <nowiki>{{Johnny}}</nowiki> will render as John1000.
In ''almost'' all cases, just call the template the name without any parameters, so for example <nowiki>{{Johnny}}</nowiki> will render as John1000.


''However'', if being used in a [[Template:MatchboxV2|matchbox]], a list, or anything that uses dynamic category rendering, you need to use the alternate method that only shows the preferred name: <nowiki>{{Johnny|u=1}}</nowiki>
''However'', if being used in a [[Template:MatchboxV2|matchbox]], a list, or anything that uses dynamic category rendering, you need to use the alternate method that only shows the preferred name: <nowiki>{{Johnny|U=1}}</nowiki>
</noinclude>
</noinclude>
{{#ifeq:{{{U}}}|1|{{{NAME}}}|{{#ifeq:{{{STAFF}}}|1|<span style="color:gold;">{{#tip-text:{{{NAME}}}|Also known as:<br>{{{ALIASES}}}}}</span>|{{#tip-text:{{{NAME}}}|Also known as:<br>{{{ALIASES}}}}}}}}}