Help:Inputbox: Difference between revisions

Content deleted Content added
TRANSWIKI: Copied from Meta:Help:Inputbox.
Addbot (talk | contribs)
m Bot: Migrating 1 interwiki links, now provided by Wikidata on d:q8615333
 
(32 intermediate revisions by 16 users not shown)
Line 1:
{{softredirect|mw:Extension:InputBox}}
{{H:h|editor toc}}
 
<div style="float:right">
__TOC__
</div>
 
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).
 
== General syntax ==
 
Inputboxes are constructed like this:
 
<pre>
<inputbox>
type=box type
parameter1=value
parameter2=value
</inputbox>
</pre>
 
The ''type'' parameter is mandatory. All other parameters are optional.
 
== Box types ==
 
{| border="1" cellspacing="5" cellpadding="5" frames="border" rules="all" bgcolor="#ffffff"
!Type
!Description
!Example
|---
|'''<font id="type_search" />type=search'''
|width="30%"|
Generates a search box with a width of 50 characters. The button labels can be specified, see below; the defaults are [[MediaWiki:Tryexact]] and [[MediaWiki:Searchfulltext]]. The text field specifies the search criteria.
|
<inputbox>
type=search
</inputbox>
|---
|'''<font id="type_create" />type=create'''
|width="30%"|
Allows creating a new page. Note especially the preload= and editintro= options below. The button label can be specified, see below; the default is [[MediaWiki:Createarticle]]. The text field specifies which page is to be edited.
|
<inputbox>
type=create
</inputbox>
|---
|'''<font id="type_comment" />type=comment'''
|width="30%"|
Add one or more sections to an existing page, or create a page, with an edit summary that is automatically the same as the (first) new section header. The button label can be specified, see below; the default is [[MediaWiki:Postcomment]]; note that this message is also used in the sidebar of the old "Standard" skin. The text field specifies which page is to be edited.
|
<inputbox>
type=comment
</inputbox>
|}
 
== Parameters ==
 
{| border="1" cellspacing="5" cellpadding="5" frames="border" rules="all" bgcolor="#ffffff"
!Parameter<br/>''Scope''
!Description
!Example
|---
|
'''<font id="par_bgcolor" />bgcolor='''<br/>
''All types''
|width="30%"|
Sets the table background color (HTML color values). Do not use quotes.
|
<pre>
<inputbox>
type=search
bgcolor=#eeeeff
</inputbox>
</pre>
 
''produces:''
 
<inputbox>
type=search
bgcolor=#eeeeff
</inputbox>
|---
|
'''<font id="par_width" />width='''<br/>
''All types''
|width="30%"|
Sets the width of the inputbox in characters.
|
<pre>
<inputbox>
type=create
width=6
</inputbox>
</pre>
 
''produces:''
 
<inputbox>
type=create
width=6
</inputbox>
|---
|
'''<font id="par_default" />default='''<br/>
''All types''
|width="30%"|
Default text to put in the inputbox.
|
<pre>
<inputbox>
type=comment
default=User talk:Eloquence
</inputbox>
</pre>
 
''produces:''
 
<inputbox>
type=comment
default=User talk:Eloquence
</inputbox>
|---
|'''<font id="par_preload" />preload='''<br/>
''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.
|
<pre>
<inputbox>
type=create
preload=Template:Standard content for new page
</inputbox>
</pre>
 
''produces:''
 
<inputbox>
type=create
preload=Template:Standard content for new page
</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 or comments. Enter the title of a non-existent page in the example inputbox, and click "Create" to test this effect.
|
<pre>
<inputbox>
type=create
editintro=Template:Instructions
</inputbox>
</pre>
 
''produces:''
 
<inputbox>
type=create
editintro=Template:Instructions
</inputbox>
|---
|'''<font id="par_buttonlabel" />buttonlabel='''<br/>''All types''
|width="30%"|
This label will be used for the main button of the form.
|
<pre>
<inputbox>
type=comment
buttonlabel=Add new rumor
</inputbox>
</pre>
 
''produces:''
 
<inputbox>
type=comment
buttonlabel=Add new rumor
</inputbox>
|---
|'''<font id="par_searchbuttonlabel" />searchbuttonlabel='''<br/>''search''
|width="30%"|
This label will be used for the "Search full text" button of the search form.
|
<pre>
<inputbox>
type=search
searchbuttonlabel=Dig deeper
</inputbox>
</pre>
 
''produces:''
 
<inputbox>
type=search
searchbuttonlabel=Dig deeper
</inputbox>
|---
|'''<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'''.
|
<pre>
<inputbox>
type=create
break=no
</inputbox>
</pre>
 
''produces:''
 
<inputbox>
type=create
break=no
</inputbox>
|}
 
Applying ''create'' to an existing page simply gives the edit page. In that case ''editintro'' and ''preload'' are ignored.
 
==Caveats==
* Variables, parameters, and templates are not allowed in values of parameters of inputbox; see [[Template talk:Inputbox demo]].
 
==Installation==
#Download and save the file [http://cvs.sourceforge.net/viewcvs.py/*checkout*/wikipedia/extensions/inputbox/inputbox.php inputbox.php] to the ''extensions'' folder of your MediaWiki installation.
#Open and edit the [[LocalSettings.php]] file by adding the following line near the bottom:
<pre>require_once(&quot;extensions/inputbox.php&quot;);</pre>
NOTE: Make sure that it is still above the closing php tag so that it looks like this:
<pre>
require_once(&quot;extensions/inputbox.php&quot;);
?>
</pre>
<!-- I make the installation more specific because adding the require_once at the top of the LocalSettings.php file (still under the opening "<?php" tag didn't work for me. Putting the line near the bottom of the file did.-->
 
==Examples==
*[[Template talk:New city in Morocco]].
*[[w:Wikipedia:Village pump (proposals)#User talk inputbox]]
{{h:f|langs=|enname=Inputbox}}
[[Category:Mediawiki Extensions|Inputbox]]
 
__NOTOC__