模板:Clickable button 2/doc

来自决策链云智库
< 模板:Clickable button 2
Zeroclanzhang讨论 | 贡献2024年1月21日 (日) 22:10的版本 (创建页面,内容为“{{Documentation subpage}} {{template shortcut|CLB2|Click}} {{lua|Module:Clickable button 2}} {{used in system}} 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. It can be used in the following ways, *'''Code: '''<code><nowiki>{{Clickable button 2|Main Page}}</nowiki></code> **'''Result: '''{{Clickable button 2|Main Page}} *'''Code: '''<code><nowiki>{{Clickable button…”)
(差异) ←上一版本 | 最后版本 (差异) | 下一版本→ (差异)

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. It can be used in the following ways,

  • Code: {{Clickable button 2|Main Page}}
  • Code: {{Clickable button 2|Main Page|Cover page}}
  • Code: {{Clickable button 2|Main Page|url=http://en.wikipedia.org}}
  • Code: {{Clickable button 2|Main Page|class=mw-ui-destructive}}
  • Code: {{Clickable button 2|Main Page|class=mw-ui-progressive}}

Note: After the changes outlined in Phabricator task T110555 were implemented, {{Clickable button 2|Main Page|class=mw-ui-constructive}} produces the same output as {{Clickable button 2|Main Page|class=mw-ui-progressive}}.

Template data

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

模板参数

此模板首选参数不换行的行内格式。

参数描述类型状态
Link/Label1

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

示例值
Foobar
页面名称必需
Label2

Defines the text that appears on the button

默认值
the page being linked to
未知推荐
URLurl

Defines a web address for the button to link to

示例值
https://www.example.com
URL可选
classclass

Defines the visual type of the button

示例值
mw-ui-progressive, mw-ui-destructive
字符串可选
Custom CSS stylingstyle

Allows custom CSS styling to be applied to the button

默认值
None
示例值
border: 2px solid red;
字符串可选
Category switchcategory

Whether or not categories should be on

默认值
yes
示例值
no
自动值
0
布尔可选

See also