Revision as of 02:12, 25 July 2012 view sourceRyan Vesey (talk | contribs)Extended confirmed users, Pending changes reviewers, Rollbackers26,107 editsm Ryan Vesey moved page User:Ryan Vesey/Clickable button to Template:Clickable button: Moving to template space← Previous edit | Revision as of 02:13, 25 July 2012 view source Ryan Vesey (talk | contribs)Extended confirmed users, Pending changes reviewers, Rollbackers26,107 edits creating documentation subpageNext edit → | ||
Line 1: | Line 1: | ||
<div class="submit ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only" role="button" aria-disabled="false"><span class="ui-button-text">{{{1|}}}</span></div> | <div class="submit ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only" role="button" aria-disabled="false"><span class="ui-button-text">{{{1|}}}</span></div><noinclude> | ||
{{documentation}} | |||
<!-- Add categories and interwikis to the /doc subpage, not here! --> | |||
</noinclude> |
Revision as of 02:13, 25 July 2012
Template documentation[view] [edit] [history] [purge] ShortcutsThis template uses Lua: |
This template is used in system messages, and on approximately 1,060,000 pages, or roughly 2% of all pages. Changes to it can cause immediate changes to the Misplaced Pages user interface. To avoid major disruption and server load, any changes should be tested in the template's /sandbox or /testcases subpages, or in your own user subpage. The tested changes can be added to this page in a single edit. Please discuss changes on the talk page before implementing them. |
Buttons should not be used in the article namespace. If the desire is to "navigate" a reader to a new page, taking them away from the current page, a link is preferred. Buttons are used within Misplaced Pages to trigger an "action". |
This template styles a link like a button, using the deprecated mediawiki.ui.button module. This expands the clickable area and tap target for the link.
Usage
- All parameters
{{Clickable button|wikilink|display|color=color|url=url|class=class|link=}}
- wikilink
- Unnamed first parameter; the title of the page being linked. Brackets are not necessary
- display (optional)
- Optional unnamed second parameter; the text to display. Not needed if the text to display is the wikilink itself
|color=
or|class=
- Color to display.
|color=
acceptsblue
andred
,|class=
acceptsmw-ui-progressive
andmw-ui-destructive
|url=
- URL to link through the button. If no wikilink/display text is provided, will show the URL, otherwise will show the wikilink/display text
|link=no
- Use this parameter set to "no" to display a button without linking to anything
Examples
Wikilinks
{{Clickable button|Main Page}}
→ Main Page{{Clickable button|Main Page|Click here to visit the main page}}
→ Main Page{{Clickable button|Click here|link=no}}
→ Click here
Colors
{{Clickable button|Main Page}}
→ Main Page – without defined|color=
and|class=
, the default is a white button{{Clickable button|Main Page|color=blue}}
→ Main Page{{Clickable button|Main Page|color=red}}
→ Main Page{{Clickable button|Main Page|class=mw-ui-progressive}}
→ Main Page{{Clickable button|Main Page|class=mw-ui-destructive}}
→ Main Page
URLs
{{Clickable button|url=https://example.com}}
→{{Clickable button|Example|url=https://example.com}}
→ Example{{Clickable button|2=Example|url=https://example.com}}
→
Template data
Styles a link like a button, using the mediawiki.ui.button module
Parameter | Description | Type | Status | |
---|---|---|---|---|
Link/Label | 1 | Defines the page to link to, and uses that page's title as the text for the button
| Page name | required |
Label | 2 | Defines the text that appears on the button
| Unknown | suggested |
URL | url | Defines a web address for the button to link to
| URL | optional |
class | class | Defines the visual type of the button
| String | optional |
Custom CSS styling | style | Allows custom CSS styling to be applied to the button
| String | optional |
Category switch | category | Whether or not categories should be on
| Boolean | optional |
color | color | no description
| Unknown | optional |
See also
- commons:Template:Clickable button, corresponding clickable button at Commons.
- Wikimedia design style guide advice on buttons
Button templates | |
---|---|
General button templates |
|
WikiProject-specific buttons |
|
Editors can experiment in this template's sandbox (edit | diff) and testcases (edit) pages.
Add categories to the /doc subpage. Subpages of this template. Categories: