Help:输入框
维基百科使用手册 |
输入框是一个MediaWiki扩展,由Erik Möller编写。创建它的最初目的是在维基新闻中加上一个“创建条目”的按钮。它需要[MW 1.5+]和扩展脚本。
通用语法
输入框的结构大致如下:
<inputbox> type=类型 参数1=值1 参数2=值3 ... </inputbox>
“type”参数必须要有。其他参数可自选。
类型
类型 | 样例 |
---|---|
type=search | |
默认宽度为50字符。按钮文字可设置,默认为MediaWiki:inputbox-tryexact和MediaWiki:inputbox-searchfulltext。下同。 | |
type=create | |
建立新页面。 | |
type=comment | |
为文本框中指定的页面新增章节,若该页面不存在则创建。 | |
type=commenttitle | |
为page参数指定的页面新增章节,若该页面不存在则创建。文本框的内容为章节标题。 |
参数
参数 类型范围 | 描述 | 样例 |
---|---|---|
bgcolor= | 设置背景色。不要设置引用。 | <inputbox>type=searchbgcolor=#eeeeff</inputbox> 得到: |
width= | 设置输入框宽度。 | <inputbox>type=createwidth=6</inputbox> 得到: |
default= | 在输入框中放置默认文字。 | <inputbox>type=commentdefault=User talk:Mountain</inputbox> 得到: |
preload= comment, create | 在新创建的页面文字框中预装文字。 | <inputbox>type=createwidth=20preload=Template:Lorem_Ipsum/core</inputbox> 得到: |
editintro= comment, create | 在編輯頁顯示MediaWiki:Missingcommenttext | <inputbox>type=commentwidth=20editintro=MediaWiki:Missingcommenttext</inputbox> 得到: |
buttonlabel= All types | 按钮文字。 | <inputbox>type=commentbuttonlabel=来造谣</inputbox> 得到: |
searchbuttonlabel= search | 此标示用作搜索全文。 | <inputbox>type=searchsearchbuttonlabel=深度优先搜索</inputbox> 得到: |
break= 所有類型 | 输入框和按钮之间是否换行。 | <inputbox>type=createwidth=30break=no</inputbox> 得到 |
page= commenttitle | 建立哪一个页面的新段落。 | <inputbox>type=commenttitlepage=Wikipedia_talk:新手入門</inputbox> 得到 |
所使用MediaWiki命名空间的文本只是样例,几乎任何页面都可使用。
MediaWiki有相關帮助:Extension:InputBox |
|