(copied from wikipedia:Template:Mw button) |
(add plainlinks if link is provided) |
||
(2 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
<span class="mw-ui-button mw-ui-{{{class|{{{2|normal}}}}}}" style="white-space:nowrap; {{{style|{{{3|}}}}}}">{{{1|{{{text|<noinclude>Example</noinclude>}}}}}}</span><noinclude> | {{#if:{{{link|}}}|<span class="plainlinks">[{{#rmatch:{{{link|}}}|pattern=\/\/|then={{{link}}} <nowiki/>|else=[{{{link}}}{{!}}}}}}<span class="mw-ui-button mw-ui-{{{class|{{{2|normal}}}}}}" style="white-space:nowrap; {{{style|{{{3|}}}}}}">{{{1|{{{text|<noinclude>Example</noinclude>}}}}}}</span>{{#if:{{{link|}}}|{{#rmatch:{{{link|}}}|pattern=\/\/|then=]|else=]]}}</span>}}<noinclude> | ||
{{documentation}} | {{documentation}} | ||
</noinclude> | </noinclude> |
Latest revision as of 21:06, 23 September 2024
Documentation (for the above template, sometimes hidden or invisible)
Description
This template renders a MediaWiki style button, like the ones used in edit forms.
Usage
The template can be used for buttons that cause a change in a page, such as for collapsible sections. It can also be used for links, such as linking to an external site.
Parameters
Render a MediaWiki styled button.
Parameter | Description | Type | Status | |
---|---|---|---|---|
Button Class | class | First choose a class for the button. After that, any addditional CSS class may be chosen for the button span.
| String | optional |
Button Style | style | Any CSS styles to add to the button span. | String | optional |
Sample
The following input:
{{MWButton|Home|link=Main Page|class=progressive}}
Produces:
The following input:
{{MWButton|Home|link=//example.com|class=progressive}}
Produces:
Please note that using external links will still display the external links warning when submitting.Visit Template:MWButton/doc to edit this text! (How does this work?)