Template:Button/doc View history

(add parameters)
(Updated doc to follow temporary change to button function)
 
(One intermediate revision by one other user not shown)
Line 6: Line 6:


== Usage ==
== Usage ==
* {{tlx|1=Button|2=text=button text}} produces {{Button|text=button text}}
* {{tlx|1=Button|2=button text}} produces {{Button|button text}}
* {{tlx|1=Button|2=text=button text|3=format=bold}} produces {{Button|text=button text|format=bold}}
* {{tlx|1=Button|2=<nowiki>[[File:WikEd close.png]]</nowiki>}} produces {{Button|[[File:CloseSquare.png]]}}
* {{tlx|1=Button|2=<nowiki>[[File:WikEd close.png]]</nowiki>|3=padTB=.1em|4=padLR=.1em}} produces {{Button|[[File:CloseSquare.png]]|padTB=.1em|padLR=.1em}}
Alternatively, {{tlx|1=Button|2=button&nbsp;text}} also produces {{Button|button text}}


== Parameters ==
== Parameters ==
This template will accept the following parameters, all are optional except for the text which does not need to be named.
This template will accept the following parameters, all are optional except for the first unnamed parameter.
* {{para|text|button text}} This is the text that will be shown in the button. This can also be used with the name as shown above by simply adding {{para||button text}}
* {{para||button text}} This is the text that will be shown in the button. It is the only unnamed parameter
<!--
* {{para|padTB|.1em}} Set the padding for the top and bottom in em units
* {{para|padTB|.1em}} Set the padding for the top and bottom in em units
* {{para|padLR|.1em}} Set the padding for the sides in em units
* {{para|padLR|.1em}} Set the padding for the sides in em units
-->
* {{para|bgcolor}} Set the background color of the button
* {{para|bgcolor}} Set the background color of the button
<!--
* {{para|fomat|bold}} Use this to make the button text bold
* {{para|fomat|bold}} Use this to make the button text bold
* {{para|style}} Use to add any CSS style codes
* {{para|style}} Use to add any CSS style codes
-->


== See also ==
== See also ==
Line 29: Line 31:


</includeonly>
</includeonly>
<!--
<templatedata>
{
"params": {
"1": {
"label": "alternate method to add text to the button",
"type": "string",
"suggested": true
},
"padTB": {
"label": "vertical padding in em units"
},
"padLR": {
"label": "horizontal (side) padding in em units"
},
"bgcolor": {
"label": "background color",
"type": "string"
},
"format": {
"label": "use this to make text bold",
"type": "boolean",
"default": "bold"
},
"style": {
"label": "CSS style codes",
"type": "string"
},
"text": {
"label": "the text in the button",
"type": "string",
"suggested": true
}
},
"description": "Add a non-functioning button to a page as an illustration",
"paramOrder": [
"text",
"1",
"bgcolor",
"format",
"padTB",
"padLR",
"style"
]
}
</templatedata>
-->

Latest revision as of 23:59, 28 December 2022

This is a documentation subpage for Template:Button.
It contains usage information, categories and other content that is not part of the original template page.

This template provides a "clickable button" formatting style for text. This button is not clickable, and care should be taken when using it to avoid readers thinking the result may be. (It has an explanatory tooltip for users hovering over it, but that may not always be displayed, or only displayed after too long a delay, so that it may not show up to people trying to click it.)

If you need a clickable button, use {{Clickable button}}.

Usage

  • {{Button|button text}} produces button text
  • {{Button|[[File:WikEd close.png]]}} produces

Parameters

This template will accept the following parameters, all are optional except for the first unnamed parameter.

  • |button text This is the text that will be shown in the button. It is the only unnamed parameter
  • |bgcolor= Set the background color of the button

See also

  • {{key press}} – used to illustrate keystrokes