Difference between revisions of "Template:Clickable button/doc"

From blackwiki
Jump to navigation Jump to search
imported>WOSlinker
m (add {{documentation subpage}})
imported>Izno
(Undid revision 989802284 by JsfasdF252 (talk) rv clutter)
 
(9 intermediate revisions by 6 users not shown)
Line 1: Line 1:
 
{{documentation subpage}}
 
{{documentation subpage}}
 +
<!-- Please place categories where indicated at the bottom of this page and interwikis at Wikidata (see [[Wikipedia:Wikidata]]) -->
 +
{{For|the more commonly used clickable button|Template:Clickable button 2}}
 
{{template shortcut|CLB|clickb}}
 
{{template shortcut|CLB|clickb}}
This template creates an area with the visual appearance of a button. This area can be placed inside a wikilink to give the link the appearance of a button, and expand its clickable size and tap target.
+
{{High use| 10346 }}
 +
This template creates an area with the visual appearance of a button. This area can be placed inside a [[wikilink]] to give the link the appearance of a button, and expand its clickable size and tap target.
  
There are two editable parameters. The first one, an unnamed one, sets the text inside the area.
+
==Usage==
 +
Unnamed parameters:
 +
* <code><nowiki>{{</nowiki>{{BASEPAGENAME}} | ''TEXT'' <nowiki>}}</nowiki></code>
 +
* <code><nowiki>{{</nowiki>{{BASEPAGENAME}} | ''TEXT'' | ''COLOR'' <nowiki>}}</nowiki></code>
  
Examples:
+
Named parameters:
 +
* <code><nowiki>{{</nowiki>{{BASEPAGENAME}} | 1= ''TEXT'' <nowiki>}}</nowiki></code>
 +
* <code><nowiki>{{</nowiki>{{BASEPAGENAME}} | 1= ''TEXT'' | color= ''COLOR'' <nowiki>}}</nowiki></code>
  
* <code style="display: block;"><nowiki>{{Clickable button|This looks like a button}}</nowiki></code> produces {{Clickable button|This looks like a button}}
+
Button with wikilink:
* <code style="display: block;"><nowiki>[[Talk:Main Page|{{Clickable button|Main page talk page}}]]</nowiki></code> produces [[Talk:Main Page|{{Clickable button|Main page talk page}}]]
+
* <code><nowiki>[[ WIKILINK | {{</nowiki>{{BASEPAGENAME}} | ''TEXT'' <nowiki>}} ]]</nowiki></code>
 +
* <code><nowiki>[[ WIKILINK | {{</nowiki>{{BASEPAGENAME}} | ''TEXT'' | color= ''COLOR'' <nowiki>}} ]]</nowiki></code>
  
The other one, named "color", allows you to change the color of the area. You can select between three colors: white (default), blue and red.
+
== Examples ==
  
To change the color of the area, you have to add the color parameter followed by the color name, like this: <code><nowiki>{{clickable button|Text|color=blue}}</nowiki></code>.
+
=== Parameter: 1 (1) ===
  
Examples:
+
Example: <code><nowiki>{{Clickable button|This looks like a button}}</nowiki></code>
 +
: Result: {{Clickable button|This looks like a button}}
  
*white (default):<br />{{Clickable button|color=white}}
+
Example: <code><nowiki>[[Talk:Main Page|{{Clickable button|Main page talk page}}]]</nowiki></code>
*blue aka. progressive:<ref group="note">After the changes outlined in Phabricator task {{Phab|T110555}} were implemented, <code><nowiki>{{Clickable button|color=green}}</nowiki></code> produces the same output as <code><nowiki>{{Clickable button|color=blue}}</nowiki></code>.</ref><br />{{Clickable button|color=blue}}
+
: Result: [[Talk:Main Page|{{Clickable button|Main page talk page}}]]
*red aka. destructive:<br />{{Clickable button|color=red}}
 
  
==Notes==
+
=== Parameter: color ===
{{reflist|group=note}}
+
You can select three colors: white (default), blue (progressive) and red (destructive):
 +
 
 +
White (Default) example: <code><nowiki>{{Clickable button|Button text|color=white}}</nowiki></code>
 +
: Result: {{Clickable button|Button text|color=white}}
 +
 
 +
Blue (Progressive) example: <code><nowiki>{{Clickable button|Button text|color=blue}}</nowiki></code>
 +
: Result: {{Clickable button|Button text|color=blue}}
 +
 
 +
Red (Destructive) example: <code><nowiki>{{Clickable button|Button text|color=red}}</nowiki></code>
 +
: Result: {{Clickable button|Button text|color=red}}
 +
 
 +
'''Note:''' After the changes outlined in Phabricator task {{Phab|T110555}} were implemented, <code><nowiki>{{Clickable button|color=green}}</nowiki></code> produces the same output as <code><nowiki>{{Clickable button|color=blue}}</nowiki></code>.
  
 
{{Button templates}}
 
{{Button templates}}
  
<includeonly>
+
<includeonly>{{Sandbox other||
<!-- Categories and interwikis go here: -->
+
<!-- Categories below this line, please; interwikis at Wikidata -->
 
[[Category:Wikipedia formatting and function templates]]
 
[[Category:Wikipedia formatting and function templates]]
 
[[Category:Wikipedia button templates]]
 
[[Category:Wikipedia button templates]]
  
</includeonly>
+
}}</includeonly>

Latest revision as of 12:31, 21 November 2020

This template creates an area with the visual appearance of a button. This area can be placed inside a wikilink to give the link the appearance of a button, and expand its clickable size and tap target.

Usage

Unnamed parameters:

  • {{Clickable button | TEXT }}
  • {{Clickable button | TEXT | COLOR }}

Named parameters:

  • {{Clickable button | 1= TEXT }}
  • {{Clickable button | 1= TEXT | color= COLOR }}

Button with wikilink:

  • [[ WIKILINK | {{Clickable button | TEXT }} ]]
  • [[ WIKILINK | {{Clickable button | TEXT | color= COLOR }} ]]

Examples

Parameter: 1 (1)

Example: {{Clickable button|This looks like a button}}

Result: This looks like a button

Example: [[Talk:Main Page|{{Clickable button|Main page talk page}}]]

Result: Main page talk page

Parameter: color

You can select three colors: white (default), blue (progressive) and red (destructive):

White (Default) example: {{Clickable button|Button text|color=white}}

Result: Button text

Blue (Progressive) example: {{Clickable button|Button text|color=blue}}

Result: Button text

Red (Destructive) example: {{Clickable button|Button text|color=red}}

Result: Button text

Note: After the changes outlined in Phabricator task T110555 were implemented, {{Clickable button|color=green}} produces the same output as {{Clickable button|color=blue}}.