Template talk:User Item

From Team Fortress Wiki
Jump to: navigation, search

Assistance, bitte!

I've spent a couple of hours on this template now and can't make it do what I want - whether I'm asking the impossible of Wikitext, making silly mistakes in the coding, or just not good enough to do it, I don't know, but I can't do it myself.

All I'm trying to do is make a userbox-type thing which displays the name of an item (or an alternate name if you want, for renamed items), along with an image. If the item is painted, the painted image should appear instead of the default item icon one. The text also changes colout depending on the quality of the item. I'm pretty sure I've got most of the coding needed, but there's still something causing the whole thing to flop, and I just can't figure out what's wrong. » Cooper Kid (blether) • (contreebs) 05:33, 4 March 2012 (PST)

{{Userbox
|border-c = white
|border-s = 0
|id-c     = white
|info-c   = white
|info-s   = 10
|info-fc  = black
|id       = {{#if:{{{paint}}}|[[File:Painted {{{name}}} {{{paint}}}.png|42px|link={{{name}}}]]
|{{#if:{{{name}}}|[[File:Item icon {{{name}}}.png|64px|link={{{name}}}]]
|[[File:TF2 crosshair.png|42px|link=Template:User Item]]
}}}}
|info     = {{#switch:{{{quality}}}
| vintage = '''<span style="color:#476291">Vintage
| genuine = '''<span style="color:#4D7455">Genuine
| strange = '''<span style="color:#CF6A32">Strange
| unusual = '''<span style="color:#8650AC">Unusual
| haunted = '''<span style="color:#8650AC">Haunted
| community = '''<span style="color:#70B04A">Community
| self-made = '''<span style="color:#70B04A">Self-Made
| valve = '''<span style="color:#A50F79">Valve}}
{{#if:{{{rename}}}|"{{{rename}}}"|{{{name}}}}}
{{#if:{{{quality}}}|</span>'''}}
{{#if:{{{paint}}}|<br>''{{#switch:{{{paint}}}
| 2F4F4F = A Color Similar to Slate''
| 7D4071 = A Deep Commitment to Purple''
| 141414 = A Distinctive Lack of Hue''
| 7E7E7E = Aged Moustache Grey''
| BcDDB3 = A Mann's Mint''
| 2D2D24 = After Eight''
| E6E6E6 = An Extraordinary Abundance of Tinge''
| E7B53B = Australium Gold''
| D8BED8 = Color No. 216-190-216''
| E9967A = Dark Salmon Injustice''
| 808000 = Drably Olive''
| 729E42 = Indubitably Green''
| CF7336 = Mann Co. Orange''
| A57545 = Muskelmannbraun''
| 51384A = Noble Hatter's Violet''
| C5AF91 = Peculiarly Drab Tincture''
| FF69B4 = Pink as Hell''
| 694D3A = Radigan Conagher Brown''
| 32CD32 = The Bitter Taste of Defeat and Lime''
| F0E68C = The Color of a Gentlemann's Business Pants''
| 7C6C57 = Ye Olde Rustic Colour''
| 424F3B = Zepheniah's Greed''
| 654740 = An Air of Debonair''
| 28394D = An Air of Debonair''
| 3B1F23 = Balaclavas are Forever''
| 18233d = Balaclavas are Forever''
| C36C2d = Cream Spirit''
| B88035 = Cream Spirit''
| 483838 = Operator's Overalls''
| 384248 = Operator's Overalls''
| B8383B = Team Spirit''
| 5885A2 = Team Spirit''
| 803020 = The Value of Teamwork''
| 256D8D = The Value of Teamwork''
| A89A8C = Waterlogged Lab Coat''
| 839FA3 = Waterlogged Lab Coat''
}}}}}}

I've reverted it to the old version - here's the new code, which isn't really working. » Cooper Kid (blether) • (contreebs) 08:49, 4 March 2012 (PST)