帮助:输入框

本页使用了标题或全文手工转换
维基百科,自由的百科全书
维基百科使用手册

输入框是一个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命名空间的文本只是样例,几乎任何页面都可使用。