Content deleted Content added
TRANSWIKI from Meta |
m 2nd attempt |
||
Line 1:
{{H:h|editor toc}}
The '''inputbox''' extension is a [[m:MediaWiki|MediaWiki]] extension by Erik Möller to add predefined HTML forms to wiki pages. It was originally created for the purpose of adding a ''Create an article'' box to [[m:Wikinews|Wikinews]]. It requires MediaWiki 1.5 and an extensions script (see ''Installation'' below).
Line 23 ⟶ 18:
== Box types ==
{| border="1" cellspacing="5" cellpadding="5" frames="border" rules="all" bgcolor="#ffffff" width="80%"
!Type
!Description
Line 30 ⟶ 25:
|'''<font id="type_search" />type=search'''
|width="30%"|
Generates a search box with a width of 50 characters<sup>1</sup>. The button labels can be specified, see below; the defaults are [[MediaWiki:Tryexact]] and [[MediaWiki:Searchfulltext]]. The text field specifies the search criteria.
|
<inputbox>
Line 50 ⟶ 45:
<inputbox>
type=comment
editintro=Template:Instructions▼
</inputbox>
|}
'''Note <sup>1</sup> :''' The default width doesn't work on old browsers resulting in an input box for one character. Specify a width explicitly (see below), <tt>width=</tt>''n'' works best with ''n'' <= 50 characters for narrow browser windows.
== Parameters ==
Line 63 ⟶ 61:
'''<font id="par_bgcolor" />bgcolor='''<br/>
''All types''
|width="30%"|Sets the table background color (HTML color values). Do not use quotes.▼
|width="30%"|▼
▲Sets the table background color (HTML color values). Do not use quotes.
|
<pre>
Line 83 ⟶ 80:
'''<font id="par_width" />width='''<br/>
''All types''
|width="30%"|Sets the width of the inputbox in characters, '''required''' for old browsers (see above).▼
|width="30%"|▼
▲Sets the width of the inputbox in characters.
|
<pre>
Line 103 ⟶ 99:
'''<font id="par_default" />default='''<br/>
''All types''
|width="30%"|Default text to put in the inputbox.
|
<pre>
Line 123 ⟶ 118:
''comment'', ''create''
|width="30%"|The text of the page under this title will be loaded into the blank editbox when a new page is created. Enter the title of a non-existent page in the example inputbox, and click "Create" to test this effect.▼
|width="30%"|▼
▲The text of the page under this title will be loaded into the blank editbox when a new page is created. Enter the title of a non-existent page in the example inputbox, and click "Create" to test this effect.
|
<pre>
<inputbox>
type=create
preload=MediaWiki:Editthispage
</inputbox>
</pre>
Line 137 ⟶ 132:
<inputbox>
type=create
preload=MediaWiki:Editthispage
</inputbox>
|---
|'''<font id="par_editintro" />editintro='''<br/>''comment'', ''create''
|width="30%"|The text of the page under this title will be added, as instructions, ''before'' the submission form for '''new''' pages
|width="30%"|▼
▲The text of the page under this title will be added, as instructions, ''before'' the submission form for new pages or comments. Enter the title of a non-existent page in the example inputbox, and click "Create" to test this effect.
|
<pre>
<inputbox>
type=
▲editintro=Template:Instructions
editintro=MediaWiki:Missingcommenttext
</inputbox>
</pre>
Line 154 ⟶ 150:
<inputbox>
type=
editintro=Mediawiki:Missingcommenttext
</inputbox>
|---
|'''<font id="par_buttonlabel" />buttonlabel='''<br/>''All types''
|width="30%"|This label will be used for the main button of the form.▼
▲This label will be used for the main button of the form.
|
<pre>
Line 177 ⟶ 173:
|---
|'''<font id="par_searchbuttonlabel" />searchbuttonlabel='''<br/>''search''
|width="30%"|This label will be used for the "Search full text" button of the search form.▼
▲This label will be used for the "Search full text" button of the search form.
|
<pre>
Line 195 ⟶ 190:
|---
|'''<font id="par_break" />break='''<br/>''yes''
|width="30%"|Whether or not to insert a line break between the input box and the button(s). Defaults to using the line break unless set to '''no'''.▼
▲Whether or not to insert a line break between the input box and the button(s). Defaults to using the line break unless set to '''no'''.
|
<pre>
Line 213 ⟶ 207:
|}
Applying ''create ''
Applying ''comment '' for a new page works, if the page already exists <tt>editintro</tt> is ignored. The texts taken from the
<tt>MediaWiki:</tt> namespace are of course only examples, any existing page can be used for <tt>editintro</tt> or <tt>preload</tt>.
==Caveats==
Line 219 ⟶ 215:
==Installation==
#Download and save the file [http://cvs.sourceforge.net/viewcvs.py/*checkout*/wikipedia/extensions/inputbox/inputbox.php?rev=1.19 inputbox.php] to the ''extensions'' folder of your MediaWiki installation. Make sure you use this link to download the extension, as the latest version in CVS does not work with the current MediaWiki release branch.
#Open and edit the [[LocalSettings.php]] file by adding the following line near the bottom:
<pre>require_once("extensions/inputbox.php");</pre>
Line 234 ⟶ 230:
{{h:f|langs=|enname=Inputbox}}
[[Category:
|