Template:Button: Difference between revisions
(Created page with "{{#if:{{{4|{{{external|}}}}}} | <span class="plainlinks">[{{{2|{{{page|}}}}}} <span class="mw-ui-button {{#switch:{{{color|white}}}|green=mw-ui-constructive|red=mw-ui-destruc...") |
No edit summary |
||
(One intermediate revision by the same user not shown) | |||
Line 34: | Line 34: | ||
| Red (destructive): actions that delete or limit something, such as deleting a page or blocking a user. | | Red (destructive): actions that delete or limit something, such as deleting a page or blocking a user. | ||
|} | |} | ||
<templatedata> | |||
{ | |||
"params": { | |||
"external": { | |||
"label": "Is the link an external page?", | |||
"description": "Use this parameter if the link you specified in \"Page\" leads to an external page.", | |||
"type": "boolean" | |||
}, | |||
"page": { | |||
"label": "Page", | |||
"description": "Page to link; can be both an internal link (article title) or an external link (full URL).", | |||
"required": true | |||
}, | |||
"color": { | |||
"label": "Color of the button", | |||
"description": "Can be white (default), blue, or red." | |||
}, | |||
"class": { | |||
"label": "Class", | |||
"description": "Additional class. Can be mw-ui-quiet, mw-ui-big, or mw-ui-block" | |||
}, | |||
"logo": { | |||
"label": "Logo", | |||
"description": "Logo to be displayed in the button, use a file name.", | |||
"type": "wiki-file-name" | |||
}, | |||
"text": { | |||
"label": "Text", | |||
"description": "Text of the button", | |||
"required": true | |||
} | |||
}, | |||
"description": "Adds a button that links to a page.", | |||
"paramOrder": [ | |||
"text", | |||
"page", | |||
"external", | |||
"color", | |||
"logo", | |||
"class" | |||
], | |||
"format": "inline" | |||
} | |||
</templatedata> | |||
[[Category:Templates]] | [[Category:Templates]] | ||
</noinclude> | </noinclude> |
Latest revision as of 13:42, 31 July 2020
This template generates a button with the same format as the MediaWiki buttons.
Syntax[edit source]
Full syntax:
{{button|text= |page= |logo= |external= |color= |class= }}
text=
, or first unnamed parameter. Text displayed in the button.page=
, or second unnamed parameter. Name of the page to be linked, accepts both internal and external links.logo=
, or third unnamed parameter (optional). Name of the file without the name space, displayed in the button. Example:Example.jpg
external=
(optional). With any value, understands the link in thepage
parameter as an external link. If it's empty or not used, the template will use the internal link syntax.color=
. The value can bewhite
(default),blue
, orred
. Each color has a meaning (see below)class=
. Additional classes are available, choose from the following:mw-ui-quiet
, for a button without borders.mw-ui-big
, for a bigger button.mw-ui-block
, for multiple buttons that display as a block with the same width..
Colors[edit source]
MediaWiki follows a consistent style for its buttons:
White (neutral). Basic format for a simple action. | |
Blue (progressive): actions that lead the user to the next step in a process. | |
Red (destructive): actions that delete or limit something, such as deleting a page or blocking a user. |
Adds a button that links to a page.
Parameter | Description | Type | Status | |
---|---|---|---|---|
Text | text | Text of the button | Unknown | required |
Page | page | Page to link; can be both an internal link (article title) or an external link (full URL). | Unknown | required |
Is the link an external page? | external | Use this parameter if the link you specified in "Page" leads to an external page. | Boolean | optional |
Color of the button | color | Can be white (default), blue, or red. | Unknown | optional |
Logo | logo | Logo to be displayed in the button, use a file name. | File | optional |
Class | class | Additional class. Can be mw-ui-quiet, mw-ui-big, or mw-ui-block | Unknown | optional |