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 2|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= accepts blue and red, |class= accepts mw-ui-progressive and mw-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 2|Main Page}}Main Page
{{Clickable button 2|Main Page|Click here to visit the main page}}Click here to visit the main page
{{Clickable button 2|Click here|link=no}}Click here

Colors แก้

{{Clickable button 2|Main Page|color=blue}}Main Page
{{Clickable button 2|Main Page|color=red}}Main Page
{{Clickable button 2|Main Page|class=mw-ui-progressive}}Main Page
{{Clickable button 2|Main Page|class=mw-ui-destructive}}Main Page

Any other color will default to white

URLs แก้

{{Clickable button 2|url=https://example.com}}https://example.com
{{Clickable button 2|Example|url=https://example.com}}Example
{{Clickable button 2|2=Example|url=https://example.com}}https://example.com

Template data แก้

ด้านล่างนี้คือข้อมูลแม่แบบ เอกสารกำกับสำหรับแม่แบบนี้ซึ่งถูกใช้งานโดยเครื่องมือแก้ไขแบบเห็นภาพและเครื่องมืออื่น ๆ

ข้อมูลแม่แบบสำหรับ Clickable button 2 (ยังไม่มีการตรวจสอบ)

แสดงผลลิงก์เป็นรูปแบบปุ่มที่คลิกได้ด้วยมอดูล mediawiki.ui.button

พารามิเตอร์แม่แบบ

แม่แบบนี้ต้องการการจัดรูปแบบพารามิเตอร์แบบอินไลน์

พารามิเตอร์คำอธิบายชนิดสถานะ
ลิงก์/ป้ายกำกับ1

ระบุหน้าปลายทางและใช้ชื่อหน้านั้นเป็นป้ายกำกับ (Label)

ตัวอย่าง
หน้าหลัก
ชื่อหน้าจำเป็น
ป้ายกำกับ2

ระบุข้อความที่จะแสดงที่ปุ่ม

ค่าปริยาย
ชื่อของหน้าที่ลิงก์ไป
ไม่ทราบชนิดแนะนำ
ยูอาร์แอลurl

ระบุที่อยู่เว็บที่ต้องการให้ปุ่มลิงก์ไป

ตัวอย่าง
https://www.example.com
ยูอาร์แอลเลือกได้
classclass

ระบุชนิดการแสดงผลของปุ่ม

ตัวอย่าง
mw-ui-progressive, mw-ui-destructive
สตริงเลือกได้
Custom CSS stylingstyle

ปรับแต่ง CSS ของปุ่มแบบอินไลน์ที่ต้องการใช้กับปุ่ม

ค่าปริยาย
ไม่มี
ตัวอย่าง
border: 2px solid red;
สตริงเลือกได้
ตั้งค่าหมวดหมู่category

ระบุว่าต้องการให้จัดหมวดหมู่หรือไม่

ค่าปริยาย
yes
ตัวอย่าง
no
ค่าอัตโนมัติ
0
ตรรกะเลือกได้

See also แก้

แม่แบบ:Button templates