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="link-button"><div>[[File:{{{1}}}|link={{{2}}}]]</div><div class="link-button-text">[{{{2}}} {{{3}}}]</div></div>
|icon2=<div class="{{#var:iconClasses}}"><div>[[File:{{{1}}}|link={{{2}}}]]</div><div class="link-button-text">[{{{2}}} {{{3}}}]</div></div>
|icon=<div class="link-button"><div>[[File:{{{1}}}|link={{{2}}}]]</div><div class="link-button-text">[[{{{2}}}|{{{3|{{{2}}}}}}]]</div></div>
|icon=<div class="{{#var:iconClasses}}"><div>[[File:{{{1}}}|link={{{2}}}]]</div><div class="link-button-text">[[{{{2}}}|{{{3|{{{2}}}}}}]]</div></div>
|#default =<div class="link-button" style="width:{{{w|94}}}px">[[{{{1}}}|{{{2|{{{1}}}}}}]]</div>
|#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

File:Template-info.svg Documentation Edit this documentation at Template:Button/doc.
(edit • history • purge)

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 to
    • 2: optional text that is displayed instead of 1
  • t: icon
    • 1: image file name
    • 2: page name for the link
    • 3: optional different name of the link text
    • i: optional width of the image
  • t: icon2
    • 1: image file name
    • 2: url for an external link
    • 3: name of the link text
    • i: optional width of the image

Example

{{Button|Frontpage-units.png|Units|t=icon}}