說明:輸入框

本頁使用了標題或全文手工轉換
維基百科,自由的百科全書
維基百科使用手冊

輸入框是一個MediaWiki擴充,由Erik Möller編寫。建立它的最初目的是在維基新聞中加上一個「建立條目」的按鈕。它需要[MW 1.5+]擴充指令碼

通用語法[編輯]

輸入框的結構大致如下:

 <inputbox>
 type=类型
 参数1=值1
 参数2=值3
 ...
 </inputbox>

「type」參數必須要有。其他參數可自選。

類型[編輯]

類型 樣例
type=search
預設寬度為50字元。按鈕文字可設置,預設為MediaWiki:inputbox-tryexactMediaWiki:inputbox-searchfulltext。下同。
type=create

建立新頁面。
type=comment

為文本框中指定的頁面新增章節,若該頁面不存在則建立。
type=commenttitle

為page參數指定的頁面新增章節,若該頁面不存在則建立。文本框的內容為章節標題。

參數[編輯]

參數
類型範圍
描述 樣例

bgcolor=
所有類型

設置背景色。不要設置參照。
<inputbox>
type=search
bgcolor=#eeeeff
</inputbox>

得到:

width=
所有類型

設置輸入框寬度。
<inputbox>
type=create
width=6
</inputbox>

得到:


default=
所有類型

在輸入框中放置預設文字。
<inputbox>
type=comment
default=User talk:Mountain
</inputbox>

得到:


preload=

comment, create

在新建立的頁面文字框中預裝文字。
<inputbox>
type=create
width=20
preload=Template:Lorem_Ipsum/core
</inputbox>

得到:


editintro=
comment, create
在編輯頁顯示MediaWiki:Missingcommenttext
<inputbox>
type=comment
width=20
editintro=MediaWiki:Missingcommenttext
</inputbox>

得到:


buttonlabel=
All types
按鈕文字。
<inputbox>
type=comment
buttonlabel=来造谣
</inputbox>

得到:


searchbuttonlabel=
search
此標示用作搜尋全文。
<inputbox>
type=search
searchbuttonlabel=深度优先搜索
</inputbox>

得到:

break=
所有類型
輸入框和按鈕之間是否換行。
<inputbox>
type=create
width=30
break=no
</inputbox>

得到

page=
commenttitle
建立哪一個頁面的新段落。
<inputbox>
type=commenttitle
page=Wikipedia_talk:新手入門
</inputbox>

得到


所使用MediaWiki命名空間的文字只是樣例,幾乎任何頁面都可使用。