Template:Button: Difference between revisions

From A KoL Wiki
imported>Dehstil
mNo edit summary
buttons in-game are transparent, may need to make the colour a parameter of the template if making them transparent doesn't work
 
(18 intermediate revisions by 8 users not shown)
Line 1: Line 1:
<includeonly>{| cellspacing="0" style="margin-left: auto; margin-right: auto; border: 2px black solid; font-family: Arial, Helvetica, sans-serif; font-size: 10pt; font-weight: bold; background-color: #FFFFFF; padding-right: 8px; padding-left: 8px;" id="{{{1}}}"
<includeonly>{| cellspacing="0" style="{{#ifeq:{{{center|y}}}|y|margin-left: auto; margin-right: auto; margin-bottom: 8px;|}}" id="{{{1}}}"
|-
|-
| {{{1}}}
| {{{pre|}}}
| style="border: 2px black solid; font-family: Arial, Helvetica, sans-serif; {{#ifeq:{{{disabled|n}}}|y|color:#CCCCCC;|}} font-size: 10pt; font-weight: bold; padding-right: 8px; padding-left: 8px;{{#if:{{{width|}}}|width:{{{width}}};}}{{#ifeq:{{{centertext|n}}}|y|text-align:center;|}}" | {{{1}}}
| {{{post|}}}{{#if:{{{bluepost|}}}|&nbsp;<span style="color:blue;">'''{{{bluepost}}}'''</span>}}
|}</includeonly><noinclude>
|}</includeonly><noinclude>


{{Code2}}
{{Code2}}
Creates a button in the style typically seen in the game.


==Usage==
==Usage==
<nowiki>{</nowiki>{button|''text''}}
{| class="wikitable"
|-
! Explanation !! Wikitext !! Result
|-
| A normal (centered) button
| <pre>{{button|Button Text}}</pre>
| {{button|Button Text}}
|-
| Button that links to another page
| <pre>{{button|[[Main Page]]}}</pre>
| {{button|[[Main Page]]}}
|-
| Un-centered button (with no left/right margins)
| <pre>{{button|Button Text|center=n}}</pre>
| {{button|Button Text|center=n}}
|-
| Button with each line of multi-line text centered, use
| <pre>{{button|Button Text|centertext=y}}</pre>
| {{button|Button Text|centertext=y}}
|-
| Grayed out button
| <pre>{{button|Button Text|disabled=y}}</pre>
| {{button|Button Text|disabled=y}}
|-
| Button with following text
| <pre>{{button|Button Text|post=(Following Text)}}</pre>
| {{button|Button Text|post=(Following Text)}}
|-
| Button with preceding text
| <pre>{{button|Button Text|pre=(Preceding Text)}}</pre>
| {{button|Button Text|pre=(Preceding Text)}}
|-
| Button with following blue text
| <pre>{{button|Button Text|bluepost=(This is blue text)}}</pre>
| {{button|Button Text|bluepost=(This is blue text)}}
|-
| Button with set width
| <pre>{{button|Button Text|width=150px}}</pre>
| {{button|Button Text|width=150px}}
|}


==Examples==
==Examples==
:<code><nowiki>{{button|Log In}}</nowiki></code> yields:
*<code><nowiki>{{button|Log In}}</nowiki></code> yields:
{{button|Log In}}
{{button|Log In}}
:<code><nowiki>{{button|Buy Item}}</nowiki></code> yields:
*<code><nowiki>{{button|Buy Item}}</nowiki></code> yields:
{{button|Buy Item}}
{{button|Buy Item}}
:<code><nowiki>{{button|Sail Away! (3)}}</nowiki></code> yields:
*<code><nowiki>{{button|Sail Away! (3)}}</nowiki></code> yields:
{{button|Sail Away! (3)}}
{{button|Sail Away! (3)}}
*<code><nowiki>{{button|[[Loathing Legion hammer]]|center=n}}</nowiki></code> yields
{{button|[[Loathing Legion hammer]]|center=n}}
*<code><nowiki>{{button|Travel back to a Delicious Meal<br>(3 minutes)|textcenter=y}}</nowiki></code> yields
{{button|Travel back to a Delicious Meal<br>(3 minutes)|textcenter=y}}
*<code><nowiki>{{button|Sneak past it|disabled=y}}</nowiki></code> yields:
{{button|Sneak past it|disabled=y}}
*<code><nowiki>{{button|Go to the First Floor|disabled=y|post=Wait, maybe not}}</nowiki></code> yields:
{{button|Go to the First Floor|disabled=y|post=Wait, maybe not}}
*<code><nowiki>{{button|Go down the elevator shaft|bluepost=[Bad idea!]}}</nowiki></code> yields:
{{button|Go down the elevator shaft|bluepost=[Bad idea!]}}


[[Category:Standardization Templates| {{PAGENAME}}]]
[[Category:Standardization Templates|{{PAGENAME}}]]</noinclude>
[[Category:Test Templates| {{PAGENAME}}]]</noinclude>

Latest revision as of 17:59, 1 May 2025


{{Button}}
{| cellspacing="0" style="{{#ifeq:{{{center|y}}}|y|margin-left: auto; margin-right: auto; margin-bottom: 8px;|}}" id="{{{1}}}"

|- | {{{pre|}}} | style="border: 2px black solid; font-family: Arial, Helvetica, sans-serif; {{#ifeq:{{{disabled|n}}}|y|color:#CCCCCC;|}} font-size: 10pt; font-weight: bold; padding-right: 8px; padding-left: 8px;{{#if:{{{width|}}}|width:{{{width}}};}}{{#ifeq:{{{centertext|n}}}|y|text-align:center;|}}" | {{{1}}} | {{{post|}}}{{#if:{{{bluepost|}}}|&nbsp;<span style="color:blue;">'''{{{bluepost}}}'''</span>}}

|}

Creates a button in the style typically seen in the game.

Usage

Explanation Wikitext Result
A normal (centered) button
{{button|Button Text}}
Button Text
Button that links to another page
{{button|[[Main Page]]}}
Main Page
Un-centered button (with no left/right margins)
{{button|Button Text|center=n}}
Button Text
Button with each line of multi-line text centered, use
{{button|Button Text|centertext=y}}
Button Text
Grayed out button
{{button|Button Text|disabled=y}}
Button Text
Button with following text
{{button|Button Text|post=(Following Text)}}
Button Text (Following Text)
Button with preceding text
{{button|Button Text|pre=(Preceding Text)}}
(Preceding Text) Button Text
Button with following blue text
{{button|Button Text|bluepost=(This is blue text)}}
Button Text  (This is blue text)
Button with set width
{{button|Button Text|width=150px}}
Button Text

Examples

  • {{button|Log In}} yields:
Log In
  • {{button|Buy Item}} yields:
Buy Item
  • {{button|Sail Away! (3)}} yields:
Sail Away! (3)
  • {{button|[[Loathing Legion hammer]]|center=n}} yields
Loathing Legion hammer
  • {{button|Travel back to a Delicious Meal<br>(3 minutes)|textcenter=y}} yields
Travel back to a Delicious Meal
(3 minutes)
  • {{button|Sneak past it|disabled=y}} yields:
Sneak past it
  • {{button|Go to the First Floor|disabled=y|post=Wait, maybe not}} yields:
Go to the First Floor Wait, maybe not
  • {{button|Go down the elevator shaft|bluepost=[Bad idea!]}} yields:
Go down the elevator shaft  [Bad idea!]