Extension:Inputbox
From MediaWiki.org
|
Inputbox Release status: stable |
|
|---|---|
| Implementation | Tag, Page action, Search |
| Description | The Inputbox extension is a 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 Wikinews. It requires at least MediaWiki 1.5 and an extensions script (see #Installation below). |
| Author(s) | Erik Möller |
| MediaWiki | 1.5+ |
| Download | SVN |
Contents |
[edit] Installation
- Download and save the files inputbox.php and InputBox.i18n.php to the extensions/inputbox/ folder of your MediaWiki installation. The most recent version of inputbox.php may not work on older MediaWiki installations. Version 1.17 works for MediaWiki 1.6.8.
You can as well check out from the subversion repository directly to the $IP/extensions/ folder, if you so wish:svn co http://svn.wikimedia.org/svnroot/mediawiki/trunk/extensions/inputbox/
- Open and edit the LocalSettings.php file by adding the following line near the bottom:
require_once($IP.'/extensions/inputbox/inputbox.php');
[edit] Example
[edit] Wiki code<inputbox> type=search width=42 buttonlabel=Go searchbuttonlabel=Search break=no </inputbox> |
[edit] Result |
This kind was found on the main page of a Wikipedia. It could be used for starting new articles, since it doesn’t go to the edit box of articles that already exist.
The Inputbox extension is a 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 Wikinews. It requires at least MediaWiki 1.5 and an extensions script (see #Installation above).
[edit] General syntax
Inputboxes are constructed like this:
<inputbox> type=box type parameter1=value parameter2=value </inputbox> |
The type parameter is mandatory. All other parameters are optional.
[edit] Box types
| Type | Example | |
|---|---|---|
| type=search |
|
|
| Generates a search box with a default width of 50 characters. The button labels can be specified, see below; defaults MediaWiki:Tryexact and MediaWiki:Searchfulltext. The text field specifies the search criteria. | ||
| type=create |
|
|
| Allows creating a new page. The button label can be specified, see below; default MediaWiki:Createarticle. The text field specifies which page is to be edited. | ||
| type=comment |
|
|
| 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; default MediaWiki:Postcomment also used in the sidebar of the "Standard" skin. The text field specifies which page is to be edited. | ||
[edit] Parameters
| Parameter Scope |
Example | |
|---|---|---|
| bgcolor= All types Sets the table background color (HTML color values). Do not use quotes. |
<inputbox> type=search bgcolor=#eeeeff </inputbox> |
|
| width= All types Sets the width of the inputbox in characters. |
<inputbox> type=create width=24 </inputbox> |
|
| default= All types Default text to put in the inputbox. |
<inputbox> type=comment default=User talk:Eloquence </inputbox> |
|
| preload= comment, create The page under this title will be preloaded (see Manual:Creating pages with preloaded text) into the blank editbox when a new page is created. |
<inputbox> type=create preload=Log </inputbox> |
|
| Enter the title of a non-existent page in the example inputbox above or below, and click "Create article" or "Post a comment" respectively to test this effect. | ||
| editintro= comment, create The text of the page under this title will be added, as instructions, before the editing window. |
<inputbox> type=comment editintro=MediaWiki:Missingcommenttext </inputbox> |
|
| buttonlabel= All types This label will be used for the main button of the form. |
<inputbox> type=comment buttonlabel=Add new rumor </inputbox> |
|
| hidden= create, comment This specifies that there is no inputbox. It is used with parameter "default", now not being a default, but the fixed value of the name of the page. |
<inputbox> type=comment editintro=Extension:Inputbox/editintro comment preload=Extension:Inputbox/preload hidden=yes default=Extension talk:Inputbox buttonlabel=Post a comment on the talk page </inputbox> |
|
| searchbuttonlabel= search This label will be used for the "Search full text" button of the search form. |
<inputbox> type=search searchbuttonlabel=Dig deeper </inputbox> |
|
| break= All types 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. |
<inputbox> type=create width=24 break=no </inputbox> |
|
| namespaces= search Support for namespace checkboxes in fulltext search. With "Namespace**" it is checked by default. |
<inputbox> type=search namespaces=Main**,Help </inputbox> |
|
Applying create to an existing page simply gives the edit page. In that case preload is ignored. Applying comment for a new page works.
The texts taken from the MediaWiki: namespace are of course only examples, any existing page can be used for editintro or preload. Unfortunately preload does not yet work for the Special:Upload summary.
Please note that variables, templates, parser functions and template parameters are not supported in inputbox parameters.
[edit] Alignment enhancement
I found that there was a need to define alignment each time I use an input box. I could have just removed the div tag from the input box HTML and specified the div when posting the inputbox. Instead I added a parameter that allows you to define the align in the code.
To use this, get an updated copy of the code here then you can specify align=left, align=center, or align=right with the other parameters.
I hope you find it useful.
[edit] Known bugs
- bugzilla:5210 - <noinclude> and <includeonly> tags are not respected from a preloaded template.
- bugzilla:5216 - Use more flexible CSS instead of bgcolor attribute for inputbox bgcolor option.
- bugzilla:13262 - New Talk Page Option.
- bugzilla:11777 - Multiple inputboxes make page invalid due to repetitive similar id
- bugzilla:6640 - Prefix option for inputbox.
- bugzilla:5067 - InputBox background should be transparent by default
- bugzilla:5552 - add a fulltext-only search mode to inputbox
- bugzilla:13909 - Trying to 'indent' an input box breaks the formatting on the rest of the page.
- bugzilla:13834 - Too much formatting!
[edit] See also
- Extension:CreateArticle
- Extension:CreateBox
- Extension:Preloader
- Extension:DPL Page Name S/N Maker-A template to create pages with serial number page names.
This extension is being used on one or more of Wikimedia's wikis. It means that the extension is stable and works well enough to be used by such high traffic websites. A full list of the extensions installed on a particular wiki is produced by Special:Version on that wiki.

