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