Difference between revisions of "Template:TechIcon"

From DSP Wiki
Jump to: navigation, search
(add size parameter)
 
Line 1: Line 1:
<includeonly><templatestyles src="TechIcon/style.css" /><div class="tech_icon_container">[[File:Tech_{{{TechName|{{{1|Unknown}}}}}}{{#if:{{{Level|{{{2|}}}}}}|_{{{Level|{{{2|}}}}}}}}.png|link={{{TechName|{{{1|}}}}}}_({{{Type|{{#if:{{{Level|{{{2|}}}}}}|Upgrade|Tech}}}}})]]</div></includeonly><noinclude>{{documentation}}[[Category:Template]]</noinclude>
+
<includeonly><templatestyles src="TechIcon/style.css" /><div class="tech_icon_container">[[File:Tech_{{{TechName|{{{1|Unknown}}}}}}{{#if:{{{Level|{{{2|}}}}}}|_{{{Level|{{{2|}}}}}}}}.png{{#if:{{{size|}}}|{{!}}{{{size}}}}}|link={{{TechName|{{{1|}}}}}}_({{{Type|{{#if:{{{Level|{{{2|}}}}}}|Upgrade|Tech}}}}})]]</div></includeonly><noinclude>{{documentation}}[[Category:Template]]</noinclude>

Latest revision as of 22:51, 26 June 2021

Template documentation (for the above template, sometimes hidden or invisible)
[editview]
Usage:
{{TechIcon
|TechName=
|Level=
}}

NOTE: The TechName is used to construct the filename for the icon shown. For example, providing "Unknown" as in the example below, the template looks for and loads "Tech_Unknown.png". If the image does not exist, it will show as a broken image. Be sure to spell things the same. For multiple-word item names, use a space between the words as per normal. If the Level parameter is specified and equal to "1", the template will look for the filename "Tech_Unknown_1.png" instead.

The image will link to the page with a name in the "TechName_(Tech)" form if Level is not specified, otherwise it will link to the "TechName_(Upgrade)" page. The word in the parentheses may be overridden by supplying the optional "Type" parameter.


Example: The following wiki code
{{TechIcon|Universe Exploration|1}}
OR
{{TechIcon
|TechName=Universe Exploration
|Level=1
}}

Will display an icon with link the item:

Tech Universe Exploration 1.png
Visit Template:TechIcon/doc to edit this text! (How does this work?) (Refresh this text - why?)