Predloga:Gumb na klik
| Predloga se uporablja na številnih straneh, zato bo vsaka njena sprememba takoj zelo opazna. Prosimo, da vse spremembe, ki jih želite uvesti, pred uvedbo preizkusite na podstraneh predloge (/peskovnik in /testniprimeri) ali na svojih lastnih podstraneh. Pred spreminjanjem te predloge se o želenih spremembah rajši pogovorite na pogovorni strani. |
| Uporablja Lua: |
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
[uredi kodo]- All parameters
{{Gumb na klik|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=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
[uredi kodo]Wikilinks
[uredi kodo]{{Gumb na klik|Main Page}}→{{Gumb na klik|Main Page|Click here to visit the main page}}→{{Gumb na klik|Click here|link=no}}→
Colors
[uredi kodo]{{Gumb na klik|Main Page}}→ – without defined|color=and|class=, the default is a white button{{Gumb na klik|Main Page|color=blue}}→{{Gumb na klik|Main Page|color=red}}→{{Gumb na klik|Main Page|class=mw-ui-progressive}}→{{Gumb na klik|Main Page|class=mw-ui-destructive}}→
URLs
[uredi kodo]{{Gumb na klik|url=https://example.com}}→{{Gumb na klik|Example|url=https://example.com}}→{{Gumb na klik|2=Example|url=https://example.com}}→
Adding an icon
[uredi kodo]Adding an icon to a button should be avoided. Don't forget to hide the icon from the accessibility DOM by wrapping it in a span that is Predloga:Attr so that a screen reader doesn't read it out loud.
<span class="mw-ui-button mw-ui-progressive"><span aria-hidden="true">[[File:OOjs UI icon logo-wikimediaCommons-invert.svg|15px|link=|alt=]]</span> More details</span>
Template data
[uredi kodo]Styles a link like a button, using the mediawiki.ui.button module
| Parameter | Opis | Vrsta | Stanje | |
|---|---|---|---|---|
| Link/Label | 1 | Defines the page to link to, and uses that page's title as the text for the button
| Ime strani | zahtevano |
| Label | 2 | Defines the text that appears on the button
| Neznano | predlagano |
| URL | url | Defines a web address for the button to link to
| URL | neobvezno |
| class | class | Defines the visual type of the button
| Niz | neobvezno |
| Custom CSS styling | style | Allows custom CSS styling to be applied to the button
| Niz | neobvezno |
| Category switch | category | Whether or not categories should be on
| Bool | neobvezno |
| color | color | Defines the visual type of the button
| Niz | neobvezno |
See also
[uredi kodo]- commons:Template:Clickable button, corresponding clickable button at Commons.
- phab:T146923, which dropped support for
mw-ui-constructive, the CSS class for green buttons