Help:输入框
维库,知识与思想的自由文库
输入框是一个MediaWiki扩展,由Erik Möller编写。创建它的最初目的是在维基新闻中加上一个“创建条目”的按钮。它需要[MW 1.5+],和扩展脚本。
目录 |
[编辑] 通用语法
输入框的结构大致如下:
<inputbox> type=类型 参数1=值1 参数2=值3 </inputbox>
“type”参数必须要有。其他参数可自选。
[编辑] 类型
| 类型 | 样例 | |
|---|---|---|
| type=search |
|
|
| 默认宽度为50字符。按钮文字可设置,默认为MediaWiki:Tryexact和MediaWiki:Searchfulltext。下同。 | ||
| type=create |
|
|
| 创造新页面。 | ||
| type=comment |
|
|
| 向存在页面添加章节,或创造页面。编辑摘要自动为章节标题。 | ||
[编辑] 参数
| 参数 类型范围 |
描述 | 样例 | |
|---|---|---|---|
|
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=MediaWiki:Editthispage </inputbox> 得到: |
|
| editintro= comment, create |
(不清楚) |
<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= yes |
输入框和按钮之间是否换行。 |
<inputbox> type=create break=yes </inputbox> 得到 |
所使用MediaWiki名字空间的文本只是样例,几乎任何页面都可使用。
[编辑] 警告
- 变量、参数、模板不可用于输入框。




