Jump to content

Template:Clickable button 2/doc

From Wikiversity

Error: no shortcuts were specified and the |msg= parameter was not set.

Template:Warning

This template styles a link like a button, using the mediawiki.ui.button module. This expands the clickable area and tap target for the link.

Usage

[edit]

All parameters:

{{Clickable button 2|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= accepts blue and red, |class= accepts mw-ui-progressive and mw-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

[edit]
[edit]
Template:Demo inline
Template:Demo inline
Template:Demo inline

Colors

[edit]
Template:Demo inline
Template:Demo inline
Template:Demo inline
Template:Demo inline

Any other color will default to white

URLs

[edit]
Template:Demo inline
Template:Demo inline
Template:Demo inline

Template data

[edit]

Styles a link like a button, using the mediawiki.ui.button module

Template parameters

This template prefers inline formatting of parameters.

ParameterDescriptionTypeStatus
Link/Label1

Defines the page to link to, and uses that page's title as the text for the button

Example
Foobar
Page namerequired
Label2

Defines the text that appears on the button

Default
the page being linked to
Unknownsuggested
URLurl

Defines a web address for the button to link to

Example
https://www.example.com
URLoptional
classclass

Defines the visual type of the button

Suggested values
mw-ui-progressive mw-ui-destructive
Stringoptional
Custom CSS stylingstyle

Allows custom CSS styling to be applied to the button

Default
None
Example
border: 2px solid red;
Stringoptional
Category switchcategory

Whether or not categories should be on

Default
yes
Example
no
Auto value
0
Booleanoptional

See also

[edit]