Welcome to Wargaming.net Wiki!
Variants

Difference between revisions of "Template:Legends ShipList"

Jump to: navigation, search
Revision as of 13:38, 10 September 2019Revision as of 13:45, 10 September 2019
Line 21:Line 21:
 The while-loop creates a new table-row for every single element of the list and displays the image and a link to the ship. No check wether these ship names are correct or not!--> The while-loop creates a new table-row for every single element of the list and displays the image and a link to the ship. No check wether these ship names are correct or not!-->
 <tr> <tr>
?{{#if:{{{tier1|}}}|<td width="14%"><!-- Tier I --><table>{{#while:|{{#explode:{{{tier1|}}}|,|{{#var:i}}}}|{{#vardefine:str|{{#explode:{{{tier1|}}}|,|{{#var:i}}}}}}<tr><td>[[File:Legends_{{#var:str}}.png|link=Navy:{{#var:str}}|125px]]<br>+{{#if:{{{tier1|}}}|<td width="14%"><!-- Tier I --><table class="legends-ship-list-sub">{{#while:|{{#explode:{{{tier1|}}}|,|{{#var:i}}}}|{{#vardefine:str|{{#explode:{{{tier1|}}}|,|{{#var:i}}}}}}<tr><td>[[File:Legends_{{#var:str}}.png|link=Navy:{{#var:str}}|125px]]<br>
 [[Navy:{{#var:str}}|{{#var:str}}]]</td></tr>{{#vardefine:i|{{#expr:{{#var:i}}+1}}}} [[Navy:{{#var:str}}|{{#var:str}}]]</td></tr>{{#vardefine:i|{{#expr:{{#var:i}}+1}}}}
 }}</table></td>{{#vardefine:i|0}}}} }}</table></td>{{#vardefine:i|0}}}}
?{{#if:{{{tier2|}}}|<td width="14%"><!-- Tier II --><table>{{#while:|{{#explode:{{{tier2|}}}|,|{{#var:i}}}}|{{#vardefine:str|{{#explode:{{{tier2|}}}|,|{{#var:i}}}}}}<tr><td>[[File:Legends_{{#var:str}}.png|link=Navy:{{#var:str}}|125px]]<br>+{{#if:{{{tier2|}}}|<td width="14%"><!-- Tier II --><table class="legends-ship-list-sub">{{#while:|{{#explode:{{{tier2|}}}|,|{{#var:i}}}}|{{#vardefine:str|{{#explode:{{{tier2|}}}|,|{{#var:i}}}}}}<tr><td>[[File:Legends_{{#var:str}}.png|link=Navy:{{#var:str}}|125px]]<br>
 [[Navy:{{#var:str}}|{{#var:str}}]]</td></tr>{{#vardefine:i|{{#expr:{{#var:i}}+1}}}} [[Navy:{{#var:str}}|{{#var:str}}]]</td></tr>{{#vardefine:i|{{#expr:{{#var:i}}+1}}}}
 }}</table></td>{{#vardefine:i|0}}}} }}</table></td>{{#vardefine:i|0}}}}
?{{#if:{{{tier3|}}}|<td width="14%"><!-- Tier III --><table>{{#while:|{{#explode:{{{tier3|}}}|,|{{#var:i}}}}|{{#vardefine:str|{{#explode:{{{tier3|}}}|,|{{#var:i}}}}}}<tr><td>[[File:Legends_{{#var:str}}.png|link=Navy:{{#var:str}}|125px]]<br>+{{#if:{{{tier3|}}}|<td width="14%"><!-- Tier III --><table class="legends-ship-list-sub">{{#while:|{{#explode:{{{tier3|}}}|,|{{#var:i}}}}|{{#vardefine:str|{{#explode:{{{tier3|}}}|,|{{#var:i}}}}}}<tr><td>[[File:Legends_{{#var:str}}.png|link=Navy:{{#var:str}}|125px]]<br>
 [[Navy:{{#var:str}}|{{#var:str}}]]</td></tr>{{#vardefine:i|{{#expr:{{#var:i}}+1}}}} [[Navy:{{#var:str}}|{{#var:str}}]]</td></tr>{{#vardefine:i|{{#expr:{{#var:i}}+1}}}}
 }}</table></td>{{#vardefine:i|0}}}} }}</table></td>{{#vardefine:i|0}}}}
?{{#if:{{{tier4|}}}|<td width="14%"><!-- Tier IV --><table>{{#while:|{{#explode:{{{tier4|}}}|,|{{#var:i}}}}|{{#vardefine:str|{{#explode:{{{tier4|}}}|,|{{#var:i}}}}}}<tr><td>[[File:Legends_{{#var:str}}.png|link=Navy:{{#var:str}}|125px]]<br>+{{#if:{{{tier4|}}}|<td width="14%"><!-- Tier IV --><table class="legends-ship-list-sub">{{#while:|{{#explode:{{{tier4|}}}|,|{{#var:i}}}}|{{#vardefine:str|{{#explode:{{{tier4|}}}|,|{{#var:i}}}}}}<tr><td>[[File:Legends_{{#var:str}}.png|link=Navy:{{#var:str}}|125px]]<br>
 [[Navy:{{#var:str}}|{{#var:str}}]]</td></tr>{{#vardefine:i|{{#expr:{{#var:i}}+1}}}} [[Navy:{{#var:str}}|{{#var:str}}]]</td></tr>{{#vardefine:i|{{#expr:{{#var:i}}+1}}}}
 }}</table></td>{{#vardefine:i|0}}}} }}</table></td>{{#vardefine:i|0}}}}
?{{#if:{{{tier5|}}}|<td width="14%"><!-- Tier V --><table>{{#while:|{{#explode:{{{tier5|}}}|,|{{#var:i}}}}|{{#vardefine:str|{{#explode:{{{tier5|}}}|,|{{#var:i}}}}}}<tr><td>[[File:Legends_{{#var:str}}.png|link=Navy:{{#var:str}}|125px]]<br>+{{#if:{{{tier5|}}}|<td width="14%"><!-- Tier V --><table class="legends-ship-list-sub">{{#while:|{{#explode:{{{tier5|}}}|,|{{#var:i}}}}|{{#vardefine:str|{{#explode:{{{tier5|}}}|,|{{#var:i}}}}}}<tr><td>[[File:Legends_{{#var:str}}.png|link=Navy:{{#var:str}}|125px]]<br>
 [[Navy:{{#var:str}}|{{#var:str}}]]</td></tr>{{#vardefine:i|{{#expr:{{#var:i}}+1}}}} [[Navy:{{#var:str}}|{{#var:str}}]]</td></tr>{{#vardefine:i|{{#expr:{{#var:i}}+1}}}}
 }}</table></td>{{#vardefine:i|0}}}} }}</table></td>{{#vardefine:i|0}}}}
?{{#if:{{{tier6|}}}|<td width="14%"><!-- Tier VI --><table>{{#while:|{{#explode:{{{tier6|}}}|,|{{#var:i}}}}|{{#vardefine:str|{{#explode:{{{tier6|}}}|,|{{#var:i}}}}}}<tr><td>[[File:Legends_{{#var:str}}.png|link=Navy:{{#var:str}}|125px]]<br>+{{#if:{{{tier6|}}}|<td width="14%"><!-- Tier VI --><table class="legends-ship-list-sub">{{#while:|{{#explode:{{{tier6|}}}|,|{{#var:i}}}}|{{#vardefine:str|{{#explode:{{{tier6|}}}|,|{{#var:i}}}}}}<tr><td>[[File:Legends_{{#var:str}}.png|link=Navy:{{#var:str}}|125px]]<br>
 [[Navy:{{#var:str}}|{{#var:str}}]]</td></tr>{{#vardefine:i|{{#expr:{{#var:i}}+1}}}} [[Navy:{{#var:str}}|{{#var:str}}]]</td></tr>{{#vardefine:i|{{#expr:{{#var:i}}+1}}}}
 }}</table></td>{{#vardefine:i|0}}}} }}</table></td>{{#vardefine:i|0}}}}
?{{#if:{{{tier7|}}}|<td width="14%"><!-- Tier VII --><table>{{#while:|{{#explode:{{{tier7|}}}|,|{{#var:i}}}}|{{#vardefine:str|{{#explode:{{{tier7|}}}|,|{{#var:i}}}}}}<tr><td>[[File:Legends_{{#var:str}}.png|link=Navy:{{#var:str}}|125px]]<br>+{{#if:{{{tier7|}}}|<td width="14%"><!-- Tier VII --><table class="legends-ship-list-sub">{{#while:|{{#explode:{{{tier7|}}}|,|{{#var:i}}}}|{{#vardefine:str|{{#explode:{{{tier7|}}}|,|{{#var:i}}}}}}<tr><td>[[File:Legends_{{#var:str}}.png|link=Navy:{{#var:str}}|125px]]<br>
 [[Navy:{{#var:str}}|{{#var:str}}]]</td></tr>{{#vardefine:i|{{#expr:{{#var:i}}+1}}}} [[Navy:{{#var:str}}|{{#var:str}}]]</td></tr>{{#vardefine:i|{{#expr:{{#var:i}}+1}}}}
 }}</table></td>{{#vardefine:i|0}}}}</tr></table></div>}}</div></div></div></includeonly> }}</table></td>{{#vardefine:i|0}}}}</tr></table></div>}}</div></div></div></includeonly>
 <noinclude>{{doc}}[[Category:Legends-templates]]</noinclude> <noinclude>{{doc}}[[Category:Legends-templates]]</noinclude>

Revision as of 13:45, 10 September 2019

Documentation‎

Usage:

{{Legends_ShipList
|section=
|text=
|tier1=
|tier2=
|tier3=
|tier4=
|tier5=
|tier6=
|tier7=
|tier8=
|tier9=
}}

Important: Section should contain only one word! Available are Cruisers, Battleships, Destroyers and Aircraft Carriers.
For each tier a comma separated list of ships might be inserted. Ship names have to be spelled correct, otherwise neither the ship link nor the image will be displayed correct. The ships have to be separated by commas only, there must be no extra space except if it is part of the ship's name!