Difference between revisions of "Template:Icons"

From Star Trek Timelines Wiki
Jump to navigation Jump to search
(add flip param)
Line 1: Line 1:
 
<onlyinclude><includeonly>{{safesubst:#ifexpr:{{{1|0}}}<1
 
<onlyinclude><includeonly>{{safesubst:#ifexpr:{{{1|0}}}<1
|{{icons/1|{{{name|}}}|Basic}}{{safesubst:#ifexpr:{{{2|5}}}>0|<nowiki></nowiki>
+
|{{#if:{{{flip|}}}|{{icons/2|{{{flip}}}|Basic}}|{{icons/1|{{{name|}}}|Basic}}}}{{safesubst:#ifexpr:{{{2|5}}}>0|<nowiki></nowiki>
 
{{!}}}}}}{{safesubst:#ifexpr:({{{1|0}}}<2) and ({{{2|5}}}>0)
 
{{!}}}}}}{{safesubst:#ifexpr:({{{1|0}}}<2) and ({{{2|5}}}>0)
|{{icons/1|{{{name|}}}|Common}}{{safesubst:#ifexpr:{{{2|5}}}>1|<nowiki></nowiki>
+
|{{#if:{{{flip|}}}|{{icons/2|{{{flip}}}|Common}}|{{icons/1|{{{name|}}}|Common}}}}{{safesubst:#ifexpr:{{{2|5}}}>1|<nowiki></nowiki>
 
{{!}}}}}}{{safesubst:#ifexpr:({{{1|0}}}<3) and ({{{2|5}}}>1)
 
{{!}}}}}}{{safesubst:#ifexpr:({{{1|0}}}<3) and ({{{2|5}}}>1)
|{{icons/1|{{{name|}}}|Uncommon}}{{safesubst:#ifexpr:{{{2|5}}}>2|<nowiki></nowiki>
+
|{{#if:{{{flip|}}}|{{icons/2|{{{flip}}}|Uncommon}}|{{icons/1|{{{name|}}}|Uncommon}}}}{{safesubst:#ifexpr:{{{2|5}}}>2|<nowiki></nowiki>
 
{{!}}}}}}{{safesubst:#ifexpr:({{{1|0}}}<4) and ({{{2|5}}}>2)
 
{{!}}}}}}{{safesubst:#ifexpr:({{{1|0}}}<4) and ({{{2|5}}}>2)
|{{icons/1|{{{name|}}}|Rare}}{{safesubst:#ifexpr:{{{2|5}}}>3|<nowiki></nowiki>
+
|{{#if:{{{flip|}}}|{{icons/2|{{{flip}}}|Rare}}|{{icons/1|{{{name|}}}|Rare}}}}{{safesubst:#ifexpr:{{{2|5}}}>3|<nowiki></nowiki>
 
{{!}}}}}}{{safesubst:#ifexpr:({{{1|0}}}<5) and ({{{2|5}}}>3)
 
{{!}}}}}}{{safesubst:#ifexpr:({{{1|0}}}<5) and ({{{2|5}}}>3)
|{{icons/1|{{{name|}}}|SuperRare}}{{safesubst:#ifexpr:{{{2|5}}}>4|<nowiki></nowiki>
+
|{{#if:{{{flip|}}}|{{icons/2|{{{flip}}}|SuperRare}}|{{icons/1|{{{name|}}}|SuperRare}}}}{{safesubst:#ifexpr:{{{2|5}}}>4|<nowiki></nowiki>
 
{{!}}}}}}{{safesubst:#ifexpr:{{{2|5}}}>4
 
{{!}}}}}}{{safesubst:#ifexpr:{{{2|5}}}>4
|{{icons/1|{{{name|}}}|Legendary}}}}</includeonly></onlyinclude>
+
|{{#if:{{{flip|}}}|{{icons/2|{{{flip}}}|Legendary}}|{{icons/1|{{{name|}}}|Legendary}}}}}}</includeonly></onlyinclude>
 
Just because [[User:CodeHydro]] hates manually typing things. Automatic checks if item icon exists. If not, substitutes placeholder, which, when clicked, links to the destination where the file should be uploaded (saving editors from having to editing the item page itself when uploading and guaranteeing that item name will match format of others of different rarity.
 
Just because [[User:CodeHydro]] hates manually typing things. Automatic checks if item icon exists. If not, substitutes placeholder, which, when clicked, links to the destination where the file should be uploaded (saving editors from having to editing the item page itself when uploading and guaranteeing that item name will match format of others of different rarity.
  
Line 18: Line 18:
  
 
<pre>
 
<pre>
{| class=wikitable
+
{| class=wikitable style="width:800px"
 
! Icon
 
! Icon
 
| {{Icons|name=HyposprayTOS|0|2}}
 
| {{Icons|name=HyposprayTOS|0|2}}
Line 25: Line 25:
 
</pre>
 
</pre>
  
{| class=wikitable
+
{| class=wikitable style="width:800px"
 
! Icon
 
! Icon
 
| {{Icons|name=HyposprayTOS|0|2}}
 
| {{Icons|name=HyposprayTOS|0|2}}
 
|}
 
|}
  
 +
 +
 +
To flip an image, use parameter <code>|flip=</code> instead of <code>|name=</code>:
 +
 +
<pre>
 +
{| class=wikitable style="width:800px"
 +
! Icon
 +
| {{Icons|flip=HyposprayTOS|0|2}}
 +
|}
 +
 +
</pre>
 +
 +
{| class=wikitable style="width:800px"
 +
! Icon
 +
| {{Icons|flip=HyposprayTOS|0|2}}
 +
|}
  
  
Line 36: Line 52:
  
 
<pre>
 
<pre>
{| class=wikitable
+
{| class=wikitable style="width:50%"
 
! Icon
 
! Icon
 
| {{icons|name=FeragoitGoulash|1|3}} || {{icons|name=PlomeekSoup|4|5}}
 
| {{icons|name=FeragoitGoulash|1|3}} || {{icons|name=PlomeekSoup|4|5}}
Line 43: Line 59:
 
</pre>
 
</pre>
  
{| class=wikitable
+
{| class=wikitable style="width:50%"
 
! Icon
 
! Icon
 
| {{icons|name=FeragoitGoulash|1|3}} || {{icons|name=PlomeekSoup|4|5}}
 
| {{icons|name=FeragoitGoulash|1|3}} || {{icons|name=PlomeekSoup|4|5}}
 
|}
 
|}

Revision as of 15:53, 21 July 2016

Just because User:CodeHydro hates manually typing things. Automatic checks if item icon exists. If not, substitutes placeholder, which, when clicked, links to the destination where the file should be uploaded (saving editors from having to editing the item page itself when uploading and guaranteeing that item name will match format of others of different rarity.

1st and 2nd params are just like that of Template:ItemX/init and represent stars (and can be omited in the same manner; if 2nd is given, 1st may not be blank)

You may omit the name parameter for single-word names (technically you can still do for for multi-word names, but it is convention to remove all spaces and parentheses; if mw:Extension:Scribunto were installed, this stripping could be done fully automatically)

{| class=wikitable style="width:800px"
! Icon
| {{Icons|name=HyposprayTOS|0|2}}
|}

Icon
{{{3}}}<div style="position:absolute;left:Expression error: Unrecognized punctuation character "{".px;top:Expression error: Unrecognized punctuation character "{".px;width:Expression error: Unrecognized punctuation character "{".px;height:Expression error: Unrecognized punctuation character "{".px;">Expression error: Unrecognized punctuation character "{".px
{{{3}}}
{{{3}}}<div style="position:absolute;left:Expression error: Unrecognized punctuation character "{".px;top:Expression error: Unrecognized punctuation character "{".px;width:Expression error: Unrecognized punctuation character "{".px;height:Expression error: Unrecognized punctuation character "{".px;">Expression error: Unrecognized punctuation character "{".px
{{{3}}}
{{{3}}}<div style="position:absolute;left:Expression error: Unrecognized punctuation character "{".px;top:Expression error: Unrecognized punctuation character "{".px;width:Expression error: Unrecognized punctuation character "{".px;height:Expression error: Unrecognized punctuation character "{".px;">Expression error: Unrecognized punctuation character "{".px
{{{3}}}


To flip an image, use parameter |flip= instead of |name=:

{| class=wikitable style="width:800px"
! Icon
| {{Icons|flip=HyposprayTOS|0|2}}
|}

Icon
{{{3}}}<div style="position:absolute;left:Expression error: Unrecognized punctuation character "{".px;top:Expression error: Unrecognized punctuation character "{".px;width:Expression error: Unrecognized punctuation character "{".px;height:Expression error: Unrecognized punctuation character "{".px;">Expression error: Unrecognized punctuation character "{".px
{{{3}}}
<div style="position:absolute;left:Expression error: Unrecognized punctuation character "{".px;top:Expression error: Unrecognized punctuation character "{".px;overflow:hidden;transform:scaleX(-1);width:Expression error: Unrecognized punctuation character "{".px;height:Expression error: Unrecognized punctuation character "{".px"><div style="position:relative;left:-Expression error: Unrecognized punctuation character "{".px;top:-Expression error: Unrecognized punctuation character "{".px;">
{{{3}}}<div style="position:absolute;left:Expression error: Unrecognized punctuation character "{".px;top:Expression error: Unrecognized punctuation character "{".px;width:Expression error: Unrecognized punctuation character "{".px;height:Expression error: Unrecognized punctuation character "{".px;">Expression error: Unrecognized punctuation character "{".px
{{{3}}}
{{{3}}}<div style="position:absolute;left:Expression error: Unrecognized punctuation character "{".px;top:Expression error: Unrecognized punctuation character "{".px;width:Expression error: Unrecognized punctuation character "{".px;height:Expression error: Unrecognized punctuation character "{".px;">Expression error: Unrecognized punctuation character "{".px
{{{3}}}
<div style="position:absolute;left:Expression error: Unrecognized punctuation character "{".px;top:Expression error: Unrecognized punctuation character "{".px;overflow:hidden;transform:scaleX(-1);width:Expression error: Unrecognized punctuation character "{".px;height:Expression error: Unrecognized punctuation character "{".px"><div style="position:relative;left:-Expression error: Unrecognized punctuation character "{".px;top:-Expression error: Unrecognized punctuation character "{".px;">
{{{3}}}<div style="position:absolute;left:Expression error: Unrecognized punctuation character "{".px;top:Expression error: Unrecognized punctuation character "{".px;width:Expression error: Unrecognized punctuation character "{".px;height:Expression error: Unrecognized punctuation character "{".px;">Expression error: Unrecognized punctuation character "{".px
{{{3}}}
{{{3}}}<div style="position:absolute;left:Expression error: Unrecognized punctuation character "{".px;top:Expression error: Unrecognized punctuation character "{".px;width:Expression error: Unrecognized punctuation character "{".px;height:Expression error: Unrecognized punctuation character "{".px;">Expression error: Unrecognized punctuation character "{".px
{{{3}}}
<div style="position:absolute;left:Expression error: Unrecognized punctuation character "{".px;top:Expression error: Unrecognized punctuation character "{".px;overflow:hidden;transform:scaleX(-1);width:Expression error: Unrecognized punctuation character "{".px;height:Expression error: Unrecognized punctuation character "{".px"><div style="position:relative;left:-Expression error: Unrecognized punctuation character "{".px;top:-Expression error: Unrecognized punctuation character "{".px;">
{{{3}}}<div style="position:absolute;left:Expression error: Unrecognized punctuation character "{".px;top:Expression error: Unrecognized punctuation character "{".px;width:Expression error: Unrecognized punctuation character "{".px;height:Expression error: Unrecognized punctuation character "{".px;">Expression error: Unrecognized punctuation character "{".px
{{{3}}}


Item filed under one name for low rarities but another for high rarities? No problem!

{| class=wikitable style="width:50%"
! Icon
| {{icons|name=FeragoitGoulash|1|3}} || {{icons|name=PlomeekSoup|4|5}}
|}

Icon
{{{3}}}<div style="position:absolute;left:Expression error: Unrecognized punctuation character "{".px;top:Expression error: Unrecognized punctuation character "{".px;width:Expression error: Unrecognized punctuation character "{".px;height:Expression error: Unrecognized punctuation character "{".px;">Expression error: Unrecognized punctuation character "{".px
{{{3}}}
{{{3}}}<div style="position:absolute;left:Expression error: Unrecognized punctuation character "{".px;top:Expression error: Unrecognized punctuation character "{".px;width:Expression error: Unrecognized punctuation character "{".px;height:Expression error: Unrecognized punctuation character "{".px;">Expression error: Unrecognized punctuation character "{".px
{{{3}}}
{{{3}}}<div style="position:absolute;left:Expression error: Unrecognized punctuation character "{".px;top:Expression error: Unrecognized punctuation character "{".px;width:Expression error: Unrecognized punctuation character "{".px;height:Expression error: Unrecognized punctuation character "{".px;">Expression error: Unrecognized punctuation character "{".px
{{{3}}}
{{{3}}}
{{{3}}}