Difference between revisions of "Template:Category Icons"

From WikiPETia.info

(Tests)
(Removed spaces, re-added comment)
 
(48 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{ #vardefine: i | 1 }}
+
<!-- We want only 3 icons per line, therefore we need two loops -->{{ #vardefine: i | 1 }}{{ #vardefine: j | 1 }}{{ #while:
{{ #while:
 
 
   | {{{ {{ #var: i }} | }}}
 
   | {{{ {{ #var: i }} | }}}
   | {{ #switch: {{{ {{ #var: i }} | }}}
+
   | {{ #vardefine: j | {{ #expr: {{ #var: j }} + 3 }} }}
    | Bottle making = File:icon bottle.png{{!}}[[Bottle making]]
+
    {{ #tag: gallery
    | Filling = File:Icon filling.png{{!}}[[Filling]]
+
      | {{ #while:
    | Labelling = File:icon labeling.png{{!}}[[Labelling]]
+
        | {{ #ifexpr: {{ #var: i }} < {{ #var: j }} | true }}
    }}{{ #vardefine: i | {{ #expr: {{ #var: i }} + 1 }} }}<br>
+
        | <span style="display:none;">.</span>
 +
          {{ #switch: {{{ {{ #var: i }} | }}}
 +
            | Companies = File:Icon company.png{{!}}[[Companies]]
 +
            | Events = File:Icon event.png{{!}}[[Events]]
 +
            | People = File:Icon people.png{{!}}[[People]]
 +
            | Material = File:Icon material.png{{!}}[[Material]]
 +
            | Recycling = File:Icon recycling.png{{!}}[[PET recycling]]
 +
            | Preforms = File:Icon preform.png{{!}}[[Preform production]]
 +
            | Bottle making = File:Icon bottle.png{{!}}[[Bottle making]]
 +
            | Filling = File:Icon filling.png{{!}}[[Filling]]
 +
            | Capping = File:Icon capping.png{{!}}[[Capping]]
 +
            | Labelling = File:Icon labeling.png{{!}}[[Labelling]]
 +
          }}
 +
          {{ #vardefine: i | {{ #expr: {{ #var: i }} + 1 }} }}
 +
        }}
 +
      | mode = "packed-hover"
 +
    }}
 
}}
 
}}
<gallery mode="packed-hover">
 
</gallery>
 

Latest revision as of 13:31, 30 March 2017