Difference between revisions of "Template:Clickable button"

From "PTTLink Wiki"
Jump to navigation Jump to search
Mediawiki>Zhuyifei1999
m (- extra linebreak)
 
Mediawiki>Jonesey95
(colour alias)
Line 1: Line 1:
<onlyinclude>{{#if:{{{3|{{{external|}}}}}}
+
<span class="mw-ui-button {{#switch: {{{color|{{{colour|white}}}}}} | red = mw-ui-destructive | green = mw-ui-constructive | white = | blue = mw-ui-progressive}}">{{{1|Button text}}}</span><noinclude>
  | <span class="plainlinks" {{#if:{{{id|}}}|id="{{{id}}}"}}>[{{{1|{{{target|//parameter_target_is_empty.de}}}}}} <span class="submit ui-button ui-widget ui-state-default ui-corner-all {{Clickable button/iconclass
+
{{Being deleted|2021 June 18|Template:Clickable button 2|merge=Template:Clickable button 2}}
    |{{{4|{{{iconPrimary|}}}}}}
+
<!-- Add categories to the /doc subpage; interwikis go to Wikidata, thank you! -->
    |{{{5|{{{iconSecondary|}}}}}}
 
    |{{{2|{{{text|<noinclude>x</noinclude>}}}}}}
 
  }} {{{class|}}}" role="button" aria-disabled="false"><!-- // -->{{#if:{{{4|{{{iconPrimary|}}}}}}
 
  |<span class="ui-button-icon-primary ui-icon {{{4|{{{iconPrimary}}}}}}">&nbsp;</span>
 
  }}<span class="ui-button-text">{{{2|{{{text|Parameter '''text''' is empty}}}}}}</span>{{#if:{{{5|{{{iconSecondary|}}}}}}
 
  |<span class="ui-button-icon-secondary ui-icon {{{5|{{{iconSecondary|}}}}}}">&nbsp;</span>
 
  }}</span>]</span><!--
 
  -->
 
  | [[{{{1|{{{target|Parameter target is empty!}}}}}}|<span class="submit ui-button ui-widget ui-state-default ui-corner-all {{Clickable button/iconclass
 
    |{{{4|{{{iconPrimary|}}}}}}
 
    |{{{5|{{{iconSecondary|}}}}}}
 
    |{{{2|{{{text|<noinclude>x</noinclude>}}}}}}
 
  }} {{{class|}}}" role="button" aria-disabled="false" {{#if:{{{id|}}}|id="{{{id}}}"}}><!-- // -->{{#if:{{{4|{{{iconPrimary|}}}}}}
 
  |<span class="ui-button-icon-primary ui-icon {{{4|{{{iconPrimary}}}}}}">&nbsp;</span>
 
  }}<span class="ui-button-text">{{{2|{{{text|Parameter '''text''' is empty}}}}}}</span>{{#if:{{{5|{{{iconSecondary|}}}}}}
 
  |<span class="ui-button-icon-secondary ui-icon {{{5|{{{iconSecondary|}}}}}}">&nbsp;</span>
 
  }}</span>]]
 
}}<!--
 
 
 
 
 
--></onlyinclude>
 
 
{{documentation}}
 
{{documentation}}
<!-- Add categories and interwikis to Template:Clickable button/doc subpage, not here! -->
+
</noinclude>

Revision as of 23:57, 19 November 2021

Button text Template:Being deleted

Template documentationview · edit · history · purge ]
This documentation is transcluded from Template:Clickable button/doc.

Provides a button with hover effects.

Usage

{{Clickable button |target= |text= |external= }}


{{Clickable button|FAQ|Frequently asked questions}}
FAQ

{{Clickable button|target={{fullurl:{{FULLPAGENAME}}|withJS=MediaWiki:VisualFileChange.js}}|text=This page with '''VisualFileChange'''|external=true}}
Button text

{{Clickable button|:en:Wikipedia:Manual of Style/Layout|'''Wikipedia's manual of Style'''|class=ui-button-green ui-button-large}}
:en:Wikipedia:Manual of Style/Layout

{{Clickable button|:en:Wikipedia:Twinkle/Preferences|'''Twinkle preferences'''|iconPrimary=ui-icon-wrench|class=ui-button-blue ui-button-large}}
:en:Wikipedia:Twinkle/Preferences

{{Clickable button|target={{fullurl:Special:Random/User talk|action=edit&section=new&preloadtitle=I+love+your+work+because}}|text=Do something good|iconSecondary=ui-icon-heart|external=true|class=ui-button-red}}
Button text

Template parameters

ParameterDescriptionDefaultStatus
target
1
The target page of the "button". For external links, however, it is recommended using the named parameter target. Please use named parameters if it is an external link because they often contain = which would confuse the parser.emptyrequired
text
2
Text (caption) the button should carry. Either you specify text or an icon.emptyrequired
external
3
Is this an external link? If it is, set to yes or aye, or whatever you like, except nothing.emptyoptional
iconPrimary
4
A jquery UI icon class for the primary icon (in LTR languages on the left side of the button label/text). E.g. ui-icon-gear[1]emptyoptional
iconSecondary
5
A jquery UI icon class for the secondary icon (in LTR languages on the right side of the button label/text). E.g. ui-icon-triangle-1-semptyoptional
classAdd classes like ui-button-green ui-button-largeemptyoptional
idUnique id to be used as the button's ID-Attribute. Useful for JavaScript-binding and CSS-styling.emptyoptional

Additional information

The template is intended to be used in the following namespaces: all namespaces

The template is intended to be used by the following user groups: all users

Relies on:

⧼Seealso⧽

Localization

This template is not intended to be localized.

Test suite/ Unit tests

Icon onlyButton textButton textButton text
Icon textButton textButton textButton text
Text only, linksButton textButton textButton text
ColorsButton textButton textButton text