Загвар:Clickable button
Харагдац
| Энэ загвар дараах Lua-г ашигладаг: |
| Энэ загвар нь in system messages, and ойролцоогоор 1,030,000 хуудсанд, буюу нийт хуудасны 912%-д. Changes to it can cause immediate changes to the Wikipedia user interface. To avoid major disruption and server load, any changes should be tested in the загварын /sandbox эсвэл /testcases дэд хуудсанд, эсвэл өөрийн хэрэглэгчийн дэд хуудсанд туршиж үзээрэй. The tested changes can be added to this page in a single edit. Please discuss changes хэлэлцүүлгийн хуудсан дээр хэлэлц. |
| 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 Wikipedia to trigger an "action". |
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
[кодоор засварлах]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 parameer. The text to display. Not needed if the text to display is the wikilink itself
|color=or|class=- Color to display.
|color=acceptsblueandred,|class=acceptsmw-ui-progressiveandmw-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}}→{{Clickable button|Main Page|Click here to visit the main page}}→{{Clickable button|Click here|link=no}}→
Colors
[кодоор засварлах]{{Clickable button|Main Page|color=blue}}→{{Clickable button|Main Page|color=red}}→{{Clickable button|Main Page|class=mw-ui-progressive}}→{{Clickable button|Main Page|class=mw-ui-destructive}}→
Any other color will default to
URLs
[кодоор засварлах]{{Clickable button|url=https://example.com}}→{{Clickable button|Example|url=https://example.com}}→{{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 |
See also
[кодоор засварлах]- commons:Template:Clickable button, corresponding clickable button at Commons.
- Wikimedia design style guide advice on buttons