Difference between revisions of "Template:Segmented control"
Jump to navigation
Jump to search
Line 21: | Line 21: | ||
{{#vardefine:segment|{{{{{#var:i}}|}}} }} | {{#vardefine:segment|{{{{{#var:i}}|}}} }} | ||
* segment = {{#var:segment}} | * segment = {{#var:segment}} | ||
− | {{#vardefine: | + | {{#vardefine:titleAndImage|{{#explode:{{#var:segment}}|;|0}}}} |
* imageAndTitle = {{#var:imageAndTitle}} | * imageAndTitle = {{#var:imageAndTitle}} | ||
{{#vardefine:segmentLink|{{#explode:{{#var:segment}}|;|1}}}} | {{#vardefine:segmentLink|{{#explode:{{#var:segment}}|;|1}}}} | ||
* segmentLink = {{#var:segmentLink}} | * segmentLink = {{#var:segmentLink}} | ||
− | {{#vardefine: | + | {{#vardefine:segmentTitle|{{#explode:{{#var:titleAndImage}}|$|0}}}} |
− | * | + | * segmentTitle = {{#var:segmentTitle}} |
− | {{#vardefine:segmentImage|{{# | + | {{#vardefine:segmentImage|{{#explode:{{#var:titleAndImage}}|$|1}}}} |
* segmentImage = {{#var:segmentImage}} | * segmentImage = {{#var:segmentImage}} | ||
− | |||
− | |||
{{#vardefine:segmentSelected|{{#if:{{#var:segmentLink}}|true|false}}}} | {{#vardefine:segmentSelected|{{#if:{{#var:segmentLink}}|true|false}}}} | ||
* {{#var:segmentTitle}} = {{#var:segmentLink}} ({{#var:segmentSelected}}) | * {{#var:segmentTitle}} = {{#var:segmentLink}} ({{#var:segmentSelected}}) |
Revision as of 17:19, 28 March 2020
Usage example:
{{SegmentedControl |Title;Wiki page name |[Image.png]Title;Wiki page name |Selected title |etc}}