Difference between revisions of "Template:Segmented control"

From Co-Optitude Wiki
Jump to navigation Jump to search
Line 13: Line 13:
 
   {{#vardefine:segmentImage|{{#explode:{{{Icons}}}|;|{{#var:i}} }} }}
 
   {{#vardefine:segmentImage|{{#explode:{{{Icons}}}|;|{{#var:i}} }} }}
 
   {{#vardefine:segmentLink|{{#explode:{{{Links}}}|;|{{#var:i}} }} }}
 
   {{#vardefine:segmentLink|{{#explode:{{{Links}}}|;|{{#var:i}} }} }}
{{#if:{{#var:segmentLink}}|* [[{{#var:segmentLink}}|{{#if:{{#var:segmentImage}}|[[File:{{#var:segmentImage}}|20px|none|link=]] }}{{#var:segmentTitle}}]]|* {{#if:{{#var:segmentImage}}|[[File:{{#var:segmentImage}}|20px|none|link=]] }}{{#var:segmentTitle}}}}
+
{{#if:{{#var:segmentLink}}|
 +
* {{#if:{{#var:segmentImage}}|[[File:{{#var:segmentImage}}|20px|none|link={{#var:segmentLink}}]] }}[[{{#var:segmentLink}}|{{#var:segmentTitle}}]]|
 +
* {{#if:{{#var:segmentImage}}|[[File:{{#var:segmentImage}}|20px|none|link=]] }}{{#var:segmentTitle}}}}
 
   {{#vardefine:i|{{#expr:{{#var:i}}+1}}}}
 
   {{#vardefine:i|{{#expr:{{#var:i}}+1}}}}
 
}}
 
}}
 
</includeonly>
 
</includeonly>

Revision as of 18:52, 28 March 2020

Usage example:

{{SegmentedControl
  |Titles=Title 1;Title 2;Title 3}}