Difference between revisions of "Template:Crate series table/row/Sandbox"

From Team Fortress Wiki
Jump to: navigation, search
(Only change link color if a valid grade)
 
(10 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<includeonly>
+
<includeonly><nowiki></nowiki><!-- this nowiki pair ensures that we get a newline before the |- (start of row) -->
<nowiki></nowiki>
 
{{!-}}
 
{{!}} colspan="2" {{#if:{{{grade|}}}|data-grade={{{grade}}}}} style="background:#{{#switch: {{{grade}}}|Civilian=B0C3D9|Freelance=5E98D9|Mercenary=4B69FF|Commando=8847FF|Assassin=D32CE6|Elite=EB4B4B|#default=FFDDAD}};" {{!}} {{item icon|{{{item}}}}} [[{{{link|{{{item}}}}}}{{if lang}}|<span style="{{#switch: {{{grade}}}|Civilian=color:white;|Freelance=color:white;|Mercenary=color:white;|Commando=color:white;|Assassin=color:white;|Elite=color:white;}}">{{{name|{{Item name|{{{item}}}}}}}}</span>]]
 
{{!}} style="text-align:right;" {{!}} {{#if:{{{rate|}}}|{{Decimal Align|NUM={{{rate}}}|P=2|POSTFIX=%}}}}
 
{{!-}}
 
</includeonly>
 
<noinclude>
 
{|class="wikitable sortable"
 
 
|-
 
|-
! colspan="3" style="background:#F3A957;" | Test
+
| {{#if:{{{grade|}}}|data-grade={{{grade}}} class="item-grade {{lc:{{{grade}}}}}"}} | <!--
 +
 
 +
  Icon (with {{{link}} override)
 +
-->{{#if:{{{link|}}}|{{item icon|{{{item}}}|link={{{link}}}}}<!--
 +
 
 +
  Icon (with no link override)
 +
-->|{{item icon|{{{item}}}}}}}<!--
 +
 
 +
  Link target (can be overridden by {{{link}}})
 +
-->[[{{#if:{{{link|}}}|{{{link}}}|{{{item}}}{{if lang}}}}|<!--
 +
 
 +
  Set the link color to white when grade is present, for readability
 +
--><span style="{{#if:{{{grade|}}}|color: white;}}"><!--
 +
 
 +
  Link text (can be overridden by {{{name}}})
 +
-->{{#if:{{{name|}}}|{{{name}}}|{{item name|{{{item}}}}}}}</span>]]
 +
| style="text-align:right;" | {{#if:{{{rate|}}}|{{Decimal Align|NUM={{{rate}}}|P=2|POSTFIX=%}}}}</includeonly><noinclude>
 +
{{Doc begin}}
 +
Renders a single row in the {{tl|Crate series table/Sandbox}}.
 +
 
 +
=== Parameters ===
 +
:; ''item''
 +
:: Required. Used to determine the icon (and, if not overridden, the link and name)
 +
:; ''link''
 +
:: Optional. Overrides the image and text links. This template does not modify the value, so it should use {{tl|if lang}}
 +
:; ''name''
 +
:: Optional. Overrides the link text. This template does not modify the value, so it should use {{tl|item name}} (or similar).
 +
:; ''rate''
 +
:: Optional. Provides a formatted drop percentage.
 +
:; ''grade''
 +
:: Optional. Sets the background color according to the [[Grade]].
 +
 
 +
== Examples ==
 +
<pre>
 +
{{Crate series table/row/Sandbox|item=Shotgun|rate=1|grade=Civilian}}
 +
{{Crate series table/row/Sandbox|item=Shotgun|rate=1|grade=Freelance}}
 +
{{Crate series table/row/Sandbox|item=Shotgun|rate=1|grade=Mercenary}}
 +
{{Crate series table/row/Sandbox|item=Shotgun|rate=1|grade=Commando}}
 +
{{Crate series table/row/Sandbox|item=Shotgun|rate=1|grade=Assassin}}
 +
{{Crate series table/row/Sandbox|item=Shotgun|rate=1|grade=Elite}}
 +
{{Crate series table/row/Sandbox|item=Scattergun}}
 +
{{Crate series table/row/Sandbox|item=Scattergun|name=Rocket Launcher}}
 +
{{Crate series table/row/Sandbox|item=Scattergun|name=Stickybomb Launcher|link=Stickybomb Launcher}}
 +
</pre>
 +
{| class="wikitable sortable"
 
|-
 
|-
{{for|
+
! colspan="2" style="background:#F3A957;" | Table name
|{{Crate series table/row/Sandbox|item=Shotgun|rate=1|grade=Civilian}}
+
{{Crate series table/row/Sandbox|item=Shotgun|rate=1|grade=Civilian}}
|{{Crate series table/row/Sandbox|item=Shotgun|rate=1|grade=Freelance}}
+
{{Crate series table/row/Sandbox|item=Shotgun|rate=1|grade=Freelance}}
|{{Crate series table/row/Sandbox|item=Shotgun|rate=1|grade=Mercenary}}
+
{{Crate series table/row/Sandbox|item=Shotgun|rate=1|grade=Mercenary}}
|{{Crate series table/row/Sandbox|item=Shotgun|rate=1|grade=Commando}}
+
{{Crate series table/row/Sandbox|item=Shotgun|rate=1|grade=Commando}}
|{{Crate series table/row/Sandbox|item=Shotgun|rate=1|grade=Assassin}}
+
{{Crate series table/row/Sandbox|item=Shotgun|rate=1|grade=Assassin}}
|{{Crate series table/row/Sandbox|item=Shotgun|rate=1|grade=Elite}}
+
{{Crate series table/row/Sandbox|item=Shotgun|rate=1|grade=Elite}}
|{{Crate series table/row/Sandbox|item=Scattergun|rate=1|grade=notagrade}}
+
{{Crate series table/row/Sandbox|item=Scattergun}}
|{{Crate series table/row/Sandbox|item=Minigun|rate=2|grade=assassin}}
+
{{Crate series table/row/Sandbox|item=Scattergun|name=Rocket Launcher}}
|{{Crate series table/row/Sandbox|item=Hat of Undeniable Wealth and Respect|rate=97|grade=Mercenary}}
+
{{Crate series table/row/Sandbox|item=Scattergun|name=Stickybomb Launcher|link=Stickybomb Launcher}}
|{{Crate series table/row/Sandbox|item=Pistol|rate=500}}
+
|}
}}
 
{{Documentation}}
 
 
</noinclude>
 
</noinclude>

Latest revision as of 19:40, 20 November 2024

Documentation for Crate series table/row/Sandbox

Renders a single row in the {{Crate series table/Sandbox}}.

Parameters

item
Required. Used to determine the icon (and, if not overridden, the link and name)
link
Optional. Overrides the image and text links. This template does not modify the value, so it should use {{if lang}}
name
Optional. Overrides the link text. This template does not modify the value, so it should use {{item name}} (or similar).
rate
Optional. Provides a formatted drop percentage.
grade
Optional. Sets the background color according to the Grade.

Examples

{{Crate series table/row/Sandbox|item=Shotgun|rate=1|grade=Civilian}}
{{Crate series table/row/Sandbox|item=Shotgun|rate=1|grade=Freelance}}
{{Crate series table/row/Sandbox|item=Shotgun|rate=1|grade=Mercenary}}
{{Crate series table/row/Sandbox|item=Shotgun|rate=1|grade=Commando}}
{{Crate series table/row/Sandbox|item=Shotgun|rate=1|grade=Assassin}}
{{Crate series table/row/Sandbox|item=Shotgun|rate=1|grade=Elite}}
{{Crate series table/row/Sandbox|item=Scattergun}}
{{Crate series table/row/Sandbox|item=Scattergun|name=Rocket Launcher}}
{{Crate series table/row/Sandbox|item=Scattergun|name=Stickybomb Launcher|link=Stickybomb Launcher}}
Table name

ShotgunShotgun
1 .00%

ShotgunShotgun
1 .00%

ShotgunShotgun
1 .00%

ShotgunShotgun
1 .00%

ShotgunShotgun
1 .00%

ShotgunShotgun
1 .00%

ScattergunScattergun

ScattergunRocket Launcher

ScattergunStickybomb Launcher