Template:Ribbons: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 1: Line 1:
<div style="position: relative; width: {{{2}}}px;">{{
<includeonly><div style="position: relative; width: {{{2}}}px;">{{
#switch: {{{3}}}
#switch: {{{3}}}
   | 2 = <div style="position: absolute; left: {{#expr:({{{2}}}/2.6)}}px; top: {{#expr:({{{2}}}/25)}}px; padding: 0;"><!--
   | 2 = <div style="position: absolute; left: {{#expr:({{{2}}}/2.6)}}px; top: {{#expr:({{{2}}}/25)}}px; padding: 0;"><!--
Line 41: Line 41:
<div style="position: absolute; left: {{#expr:({{{2}}}/1.4)}}px; top: {{#expr:({{{2}}}/25)}}px; padding: 0;"><!--
<div style="position: absolute; left: {{#expr:({{{2}}}/1.4)}}px; top: {{#expr:({{{2}}}/25)}}px; padding: 0;"><!--
       -->[[File:Award-goldstar.png|{{#expr:({{{2}}}/4)}}px]]</div>
       -->[[File:Award-goldstar.png|{{#expr:({{{2}}}/4)}}px]]</div>
}}[[File:{{{1}}}|{{{2}}}px]]</div>
}}[[File:{{{1}}}|{{{2}}}px]]</div></includeonly>
<noinclude>[[Category:Templates]]</noinclude>
<noinclude>===Displaying Multiple Citations of the Same Service Ribbon===
 
Format:
 
<nowiki>{{Ribbons|</nowiki>'''''file name''' of service ribbon''|'''''width''' in pixels''|'''''number of times awarded'''''<nowiki>}}</nowiki>
 
So for instance, just type in
 
<pre>{{Ribbons|Awards ServiceRibbons LegionOfMerit 2011.jpg|200|4}}</pre>
 
if you earned the Legion of Merit a total of four times and you'll get the appropriate arrangement of stars!
 
{{Ribbons|Awards ServiceRibbons LegionOfMerit 2011.jpg|200|4}}
 
Let's say you've been awarded the Silver Star 7 times (wow!). You'd type in:
 
<pre>{{Ribbons|Awards ServiceRibbons SilverStar 2011.jpg|100|7}}</pre>
 
and get
 
{{Ribbons|Awards ServiceRibbons SilverStar 2011.jpg|100|7}}
 
The template currently supports up to 9 citations of the same service ribbon. Here's how they all look:
 
{| cellpadding="0" style="border: 1px solid darkgray;"
!How many?
!Ribbon
|- border="0"
| 2
| {{Ribbons|Awards ServiceRibbons SilverStar 2011.jpg|100|2}}
|-
| 3
| {{Ribbons|Awards ServiceRibbons SilverStar 2011.jpg|100|3}}
|-
| 4
| {{Ribbons|Awards ServiceRibbons SilverStar 2011.jpg|100|4}}
|-
| 5
| {{Ribbons|Awards ServiceRibbons SilverStar 2011.jpg|100|5}}
|-
| 6
| {{Ribbons|Awards ServiceRibbons SilverStar 2011.jpg|100|6}}
|-
| 7
| {{Ribbons|Awards ServiceRibbons SilverStar 2011.jpg|100|7}}
|-
| 8
| {{Ribbons|Awards ServiceRibbons SilverStar 2011.jpg|100|8}}
|-
| 9
| {{Ribbons|Awards ServiceRibbons SilverStar 2011.jpg|100|9}}
|}
 
 
And here's how it looks in a service rack:
 
{| cellpadding="0" style="border: 1px solid darkgray;"
|- border="0"
| [[File:Awards_General_Tosma1_2011.jpg|100px]]
| {{Ribbons|Awards ServiceRibbons LegionOfMerit 2011.jpg|100|4}}
|-
| {{Ribbons|Awards ServiceRibbons SilverStar 2011.jpg|100|7}}
| [[File:Awards_General_Neelix_2011.jpg‎|100px]]
|-
| [[File:Awards-ServiceRibbon-VaadwaurInvasion.jpg|100px]]
| [[File:KlingonInvasion.jpg|100px]]
|}
 
The code used for that:
 
<pre>
{| cellpadding="0" style="border: 1px solid darkgray;"
|- border="0"
| [[File:Awards_General_Tosma1_2011.jpg|100px]]
| {{Ribbons|Awards ServiceRibbons LegionOfMerit 2011.jpg|100|7}}
|-
| {{Ribbons|Awards ServiceRibbons SilverStar 2011.jpg|100|3}}
| [[File:Awards_General_Neelix_2011.jpg‎|100px]]
|-
| [[File:Awards-ServiceRibbon-VaadwaurInvasion.jpg|100px]]
| [[File:KlingonInvasion.jpg|100px]]
|}
</pre>
[[Category:Templates]]</noinclude>