แม่แบบ:Clickable button 2
หน้าตา
| แม่แบบนี้ใช้ลูอา |
| มีการใช้แม่แบบนี้ในข้อความระบบ และ ประมาณ 407,000 หน้า หรือประมาณ 35% ของหน้าทั้งหมด การแก้ไขอาจทำให้เกิดผลกระทบหรือสังเกตเห็นได้เป็นวงกว้าง เพื่อหลีกเลี่ยงผลกระทบกว้างขวางและลดภาระของเซิร์ฟเวอร์ ดังนั้นก่อนแก้ไขแม่แบบนี้จึงควรทดลองที่กระบะทราย หรือหน้าทดสอบ หรือในหน้าย่อยผู้ใช้ของคุณเองจนมั่นใจว่าไม่มีข้อผิดพลาดหน้าอภิปรายก่อนที่จะนำไปใช้ |
| Buttons should not be used in the article namespace. If the desire is to "navigate" a reader to a new page, taking them away from the current page, a link is preferred. Buttons are used within Wikipedia to trigger an "action". |
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=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
Wikilinks
Colors
{{Clickable button 2|Main Page|color=blue}}→{{Clickable button 2|Main Page|color=red}}→{{Clickable button 2|Main Page|class=mw-ui-progressive}}→{{Clickable button 2|Main Page|class=mw-ui-destructive}}→
Any other color will default to
URLs
{{Clickable button 2|url=https://example.com}}→{{Clickable button 2|Example|url=https://example.com}}→{{Clickable button 2|2=Example|url=https://example.com}}→
Template data
ด้านล่างนี้คือข้อมูลแม่แบบ เอกสารกำกับสำหรับแม่แบบนี้ซึ่งใช้งานโดยตัวช่วยสร้างแม่แบบ เครื่องมือแก้ไขแบบเห็นภาพ และเครื่องมืออื่น ดูรายงานการใช้พารามิเตอร์ประจำเดือนสำหรับแม่แบบ:Clickable button 2
ข้อมูลแม่แบบสำหรับ Clickable button 2
แสดงผลลิงก์เป็นรูปแบบปุ่มที่คลิกได้ด้วยมอดูล mediawiki.ui.button
| พารามิเตอร์ | คำอธิบาย | ชนิด | สถานะ | |
|---|---|---|---|---|
| ลิงก์/ป้ายกำกับ | 1 | ระบุหน้าปลายทางและใช้ชื่อหน้านั้นเป็นป้ายกำกับ (Label)
| ชื่อหน้า | จำเป็น |
| ป้ายกำกับ | 2 | ระบุข้อความที่จะแสดงที่ปุ่ม
| ไม่ทราบชนิด | แนะนำ |
| ยูอาร์แอล | url | ระบุที่อยู่เว็บที่ต้องการให้ปุ่มลิงก์ไป
| ยูอาร์แอล | ไม่บังคับ |
| class | class | ระบุชนิดการแสดงผลของปุ่ม
| สตริง | ไม่บังคับ |
| Custom CSS styling | style | ปรับแต่ง CSS ของปุ่มแบบอินไลน์ที่ต้องการใช้กับปุ่ม
| สตริง | ไม่บังคับ |
| ตั้งค่าหมวดหมู่ | category | ระบุว่าต้องการให้จัดหมวดหมู่หรือไม่
| ตรรกะ | ไม่บังคับ |
See also
- commons:Template:Clickable button, corresponding clickable button at Commons.
- Wikimedia design style guide advice on buttons