Please note that some information on this wiki is still based on the demo version.
If you notice any errors, feel free to correct them.
Template:Button: Difference between revisions
From Super Fantasy Kingdom Official Wiki
wgg>Cadaei moved height to css |
wgg>Cadaei added iconClass parameter |
||
| Line 1: | Line 1: | ||
<includeonly>{{#switch:{{{t}}} | <includeonly>{{#vardefine:iconClasses|link-button {{#if:{{{iconClass|}}}|{{{iconClass}}}}}}}{{#switch:{{{t}}} | ||
|icon2=<div class=" | |icon2=<div class="{{#var:iconClasses}}"><div>[[File:{{{1}}}|link={{{2}}}]]</div><div class="link-button-text">[{{{2}}} {{{3}}}]</div></div> | ||
|icon=<div class=" | |icon=<div class="{{#var:iconClasses}}"><div>[[File:{{{1}}}|link={{{2}}}]]</div><div class="link-button-text">[[{{{2}}}|{{{3|{{{2}}}}}}]]</div></div> | ||
|#default =<div class=" | |#default =<div class="{{#var:iconClasses}}" style="width:{{{w|94}}}px">[[{{{1}}}|{{{2|{{{1}}}}}}]]</div> | ||
}}</includeonly><noinclude>{{doc}} | }}</includeonly><noinclude>{{doc}} | ||
[[Category:Formatting templates]]</noinclude> | [[Category:Formatting templates]]</noinclude> | ||
Revision as of 21:07, 10 October 2025
Displays a button that links to a page, optionally with an image.
Parameters
iconClass: optional classes for the icon
Exclusive parameters
t: (no value, empty)1: page name where the button links to2: optional text that is displayed instead of1
t: icon1: image file name2: page name for the link3: optional different name of the link texti: optional width of the image
t: icon21: image file name2: url for an external link3: name of the link texti: optional width of the image
Example
{{Button|Frontpage-units.png|Units|t=icon}}


