Template:Specialization link/view: Difference between revisions

From Against the Storm Official Wiki
m (76561197969631737 moved page Template:Specialization to Template:Specialization link/view: Moving view templates as subpages under the things that use them)
(Editing code; fixing extra leading space when no icon.)
Line 1: Line 1:
<includeonly><span class="ats-link-specialization">{{#ifeq: {{{size|}}} | none  
<includeonly><span class="ats-link-specialization nowrap">{{#ifeq: {{{iconsize|}}} | none  
|<!-- then skip icon -->  
  |<!-- then skip icon -->
|<!-- else do icon -->
  |<!-- else do icon -->
[[File:{{{iconfilename|question_mark.png}}} | {{#switch:{{{size|small}}} |medium={{ImgM}}|large={{ImgL}}|huge={{ImgH}}|{{ImgS}} }}
    [[File:{{{iconfilename|question_mark.png}}} |  
|link={{{name|Specialization}}} | {{{name|}}}&nbsp;({{{type|}}}) ]]}}&nbsp;{{#ifeq: {{{1|}}} | notext
      {{#switch:{{{iconsize|small}}}  
|<!-- then skip text part -->  
        |medium={{ImgM}}
|<!-- else do text part -->[[{{{name|Specialization}}} |{{{name|}}}&nbsp;({{{type|}}})]]}}</span></includeonly><noinclude>
        |large={{ImgL}}
        |<!--default small--> {{ImgS}} }}
      |link={{{name|Specialization}}}  
      |{{{name|}}} {{#if:{{{type|}}}|({{{type|}}})|}}
    ]]
}}{{#ifeq: {{{display|}}} | notext
  |<!-- then skip text part -->  
  |<!-- else do text part -->{{#ifeq:{{{iconsize|}}}|none|<!--skip space-->|&nbsp;}}[[{{{name|Specialization}}} |{{{name|}}} {{#if:{{{type|}}}|({{{type|}}})|}}]]
}}</span></includeonly><noinclude>


This template formats a link to a specialization given an icon filename, icon size, and name of the specialization. It does no validation, so use cautiously or use [[Template:sl]].


== Example ==


<code><nowiki>{{Specialization|iconfilename=Icon_Spec_Fire_64x64.png|size=medium|name=Warmth}}</nowiki></code>
{{Specialization link/view|iconfilename=Icon_Spec_Fire_64x64.png|iconsize=small|name=Warmth}}
 
 
{{Specialization link/view|iconfilename=Icon_Spec_Fire_64x64.png|iconsize=medium|name=Warmth|type=Comfort}}
 
 
{{Specialization link/view|iconfilename=Icon_Spec_Fire_64x64.png|iconsize=large|name=Name|type=Type}}
 
 
{{Specialization link/view|iconsize=none|name=Masonry|type=Proficiency}}
 
 
{{Specialization link/view|iconfilename=Icon_Spec_Fire_64x64.png|iconsize=medium|name=Name|type=Type|display=notext}}


{{Specialization|iconfilename=Icon_Spec_Fire_64x64.png|size=medium|name=Warmth|type=Comfort}}


[[Category: Reserved templates]]
[[Category: Reserved templates]]
[[Category: Link templates]]
</noinclude>
</noinclude>

Revision as of 17:28, 8 November 2024