切換選單
切換個人選單
尚未登入
若您做出任何編輯,會公開您的 IP 位址。

「Template:链接按钮」:修訂間差異

模板頁面
刪去的內容 新增的內容
JerryHan3留言 | 貢獻
添加类别
JerryHan3留言 | 貢獻
無編輯摘要
 
(未顯示同一使用者於中間所作的 3 次修訂)
第1行: 第1行:
{{#if:{{{external|}}}
{{#if:{{{disabled|}}}
|<span class="plainlinks">[{{{link|https://chinadlrs.com/}}} <span class="mw-ui-button mw-ui-progressive mw-ui-small" {{#if:{{{color|}}}|style="border-color: {{{color|}}}; background-color: {{{color|}}}"|}}>{{{text|DL·RS 同人群官方网站}}}</span>]</span>
|<span class="mw-ui-button mw-ui-{{{mode|progressive}}} mw-ui-small" style="background-color:#c8ccd1;color:#ffffff;border-color:#c8ccd1;cursor:default;pointer-events:none;">{{{text|首页}}}</span>
|{{#if:{{{external|}}}
|[[{{{link|首页}}}|<span class="mw-ui-button mw-ui-progressive mw-ui-small" {{#if:{{{color|}}}|style="border-color: {{{color|}}}; background-color: {{{color|}}}"|}}>{{{text|首页}}}</span>]]
|<span class="plainlinks">[{{{link|https://chinadlrs.com/}}} <span class="mw-ui-button mw-ui-progressive mw-ui-small" {{#if:{{{color|}}}|style="border-color: {{{color|}}}; background-color: {{{color|}}}"|}}>{{{text|DL·RS 同人群官方网站}}}</span>]</span>
}}<noinclude>
|[[{{{link|首页}}}|<span class="mw-ui-button mw-ui-{{{mode|progressive}}} mw-ui-small" {{#if:{{{color|}}}|style="border-color: {{{color|}}}; background-color: {{{color|}}}"|}}>{{{text|首页}}}</span>]]
}}}}<noinclude>
{{doc}}
{{doc}}
<templatedata>
<templatedata>
第9行: 第11行:
"external": {
"external": {
"description": "决定按钮指向的是内链还是外链。留空为内链,填1为外链。",
"description": "决定按钮指向的是内链还是外链。留空为内链,填1为外链。",
"type": "number",
"type": "boolean",
"suggestedvalues": [
"suggestedvalues": [
"1"
"1"
]
],
"label": "外链"
},
},
"link": {
"link": {
"description": "指定按钮所链接到的页面。external参数为空时填写页面的’‘’完整名称‘’‘(包括命名空间),参数不为空时填写外部URL。",
"description": "指定按钮所链接到的页面。external参数为空时填写页面的’‘’完整名称‘’‘(包括命名空间),参数不为空时填写外部URL。",
"type": "content",
"type": "content",
"required": true
"required": true,
"label": "目标链接"
},
},
"color": {
"color": {
"description": "指定按钮的颜色。",
"description": "指定按钮的颜色。",
"type": "line"
"type": "line",
"label": "颜色",
"example": "#C00000"
},
},
"text": {
"text": {
"description": "指定按钮上显示的文本。",
"description": "指定按钮上显示的文本。",
"type": "line",
"type": "unbalanced-wikitext",
"required": true
"required": true,
"label": "按钮文本"
},
"disabled": {
"description": "填入数据以禁用按钮。",
"type": "boolean",
"suggestedvalues": [
"1"
],
"label": "禁用"
},
"mode": {
"label": "模式",
"description": "使用OOUI按钮的默认模式。",
"type": "string",
"suggestedvalues": [
"progressive",
"default",
"destructive"
]
}
}
},
},
第34行: 第59行:
"link",
"link",
"text",
"text",
"color"
"mode",
"color",
]
"disabled"
],
"format": "inline"
}
}
</templatedata>
</templatedata>

於 2023年12月1日 (五) 23:55 的最新修訂

首頁

模板文檔[查看] [編輯] [歷史] [清除緩存]

本模板會在頁面上添加一個按鈕,指向一個內部或外部鏈接。

參數列表[編輯原始碼]

參數名 說明 支持內容
external 指定鏈接是內部鏈接還是外部鏈接。可選。 數字1,或者留空。
link 指定鏈接目標。必填。 若external變量為空,填寫本站點頁面的完整標題(即包括命名空間)。
若external變量不為空,填寫外部頁面的URL。
默認內鏈為首頁,默認外鏈為DL·RS同人群官網。
text 指定顯示在按鈕上的文本。必填。 恰當描述目標頁面內容的標題。
mode 調用OOUI按鈕的默認模式。可選。 progressivedefault、或destructive
color 指定按鈕的顏色。可選。
受限於技術,指定顏色後鼠標懸浮在按鈕後顏色不會變淺。
所有CSS支持的顏色格式,如HTML顏色名、HEX顏色碼、RGB顏色碼、RGBA顏色碼、HSL顏色碼等。不建議使用過淺的顏色。
默認使用 MediaWiki 預定義的按鈕顏色 #3366cc
disabled 禁用按鈕。可選。
禁用後按鈕統一變為灰色,鏈接和動畫失效。
數字1,或者留空。

示例[編輯原始碼]

{{链接按钮|link=跳舞的线|text=原作页面}}

效果:原作頁面


{{链接按钮|link=Project:社区公约|text=跳舞的线及其饭制作品社区公约}}

效果:跳舞的線及其飯製作品社區公約


{{链接按钮|external=1|link=https://chinadlrs.com/app/|text=DL·RS同人作品下载页面}}

效果:DL·RS同人作品下載頁面


{{链接按钮|external=1|link=https://chinadlrs.com/app/|text=DL·RS同人作品下载页面|color=#ef5351}}

效果:DL·RS同人作品下載頁面


{{链接按钮|link=跳舞的线|text=原作页面|disabled=1}}

效果:原作頁面


{{链接按钮|link=跳舞的线|text=原作页面|mode=default}}

效果:原作頁面


{{链接按钮|link=跳舞的线|text=原作页面|mode=destructive}}

效果:原作頁面

上述文檔嵌入自Template:鏈接按鈕/doc(編輯 | 歷史)

添加一個鏈接到指定頁面的按鈕。

模板參數[編輯模板資料]

此模板以參數行內格式為優先。

參數描述類型狀態
外鏈external

決定按鈕指向的是內鏈還是外鏈。留空為內鏈,填1為外鏈。

建議值
1
布林值非必填
目標鏈接link

指定按鈕所鏈接到的頁面。external參數為空時填寫頁面的』『』完整名稱『』『(包括命名空間),參數不為空時填寫外部URL。

內容必填
按鈕文本text

指定按鈕上顯示的文本。

不對稱的 WikiText必填
模式mode

使用OOUI按鈕的默認模式。

建議值
progressive default destructive
字串非必填
顏色color

指定按鈕的顏色。

範例
#C00000
非必填
禁用disabled

填入數據以禁用按鈕。

建議值
1
布林值非必填
Cookies 幫助我們給予服務內容。依您有使用我們的服務,代表您同意我們使用 cookies。