Welcome to Wargaming.net Wiki!
Variants

Difference between revisions of "Template:Legends ShipList"

Jump to: navigation, search
Revision as of 13:33, 10 September 2019Revision as of 13:37, 10 September 2019
Line 10:Line 10:
 <div style="width:100%;overflow:auto;"><table class="legends-ship-list"> <div style="width:100%;overflow:auto;"><table class="legends-ship-list">
 <tr> <tr>
?<th>Tier I</th>+{{#if:{{{tier1|}}}|<th>Tier I</th>}}
?<th>Tier II</th>+{{#if:{{{tier2|}}}|<th>Tier II</th>}}
?<th>Tier III</th>+{{#if:{{{tier3|}}}|<th>Tier III</th>}}
?<th>Tier IV</th>+{{#if:{{{tier4|}}}|<th>Tier IV</th>}}
?<th>Tier V</th>+{{#if:{{{tier5|}}}|<th>Tier V</th>}}
?<th>Tier VI</th>+{{#if:{{{tier6|}}}|<th>Tier VI</th>}}
?<th>Tier VII</th>+{{#if:{{{tier7|}}}|<th>Tier VII</th>}}
 </tr> </tr>
 <!--all ships have to be inserted below. A comma separated list is required, no white-spaces allowed! <!--all ships have to be inserted below. A comma separated list is required, no white-spaces allowed!
 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>
?<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]]+{{#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]]
 [[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}}}}
?<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]]+{{#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]]
 [[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}}}}
?<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]]+{{#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]]
 [[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}}}}
?<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]]+{{#if:{{{tier1|}}}|<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]]
 [[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}}}}
?<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]]+{{#if:{{{tier1|}}}|<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]]
 [[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}}}}
?<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]]+{{#if:{{{tier1|}}}|<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]]
 [[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}}}}
?<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]]+{{#if:{{{tier1|}}}|<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]]
 [[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:37, 10 September 2019

Documentation‎

Usage:

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

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!