Help:Inputbox

From Meta, a Wikimedia project coordination wiki
This is an archived version of this page, as edited by 69.57.247.141 (talk) at 18:37, 9 October 2005 (→‎Installation). It may differ significantly from the current version.

Template:H:hns

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 MediaWiki 1.5.

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.

Box types

Type Description Example
type=search

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.

type=create

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.


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; the default is MediaWiki:Postcomment; note that this message is also used in the sidebar of the old "Standard" skin.


Parameters

Parameter
Scope
Description Example

bgcolor=
All types

Sets the table background color (HTML color values). Do not use quotes.

<inputbox>
type=search
bgcolor=#eeeeff
</inputbox>

produces:

width=
All types

Sets the width of the inputbox in characters.

<inputbox>
type=create
width=6
</inputbox>

produces:


default=
All types

Default text to put in the inputbox.

<inputbox>
type=comment
default=User talk:Eloquence
</inputbox>

produces:


preload=

comment, create

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.

<inputbox>
type=create
preload=Template:Standard content for new page
</inputbox>

produces:


editintro=
comment, create

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.

<inputbox>
type=create
editintro=Template:Instructions
</inputbox>

produces:


buttonlabel=
All types

This label will be used for the main button of the form.

<inputbox>
type=comment
buttonlabel=Add new rumor
</inputbox>

produces:


searchbuttonlabel=
search

This label will be used for the "Search full text" button of the search form.

<inputbox>
type=search
searchbuttonlabel=Dig deeper
</inputbox>

produces:

Applying create to an existing page simply gives the edit page. In that case editintro and preload are ignored.

Caveats

Installation

  1. Download and save the file inputbox.php to the extensions folder of your MediaWiki installation.
  2. Open and edit the LocalSettings.php file by adding the following line near the bottom:
require_once("extensions/inputbox.php");

NOTE: Make sure that it is still above the closing php tag so that it looks like this:

require_once("extensions/inputbox.php");
?>

Examples

Links to other help pages

Help contents
Meta · Wikinews · Wikipedia · Wikiquote · Wiktionary · Commons: · Wikidata · MediaWiki · Wikibooks · Wikisource · MediaWiki: Manual · Google
Versions of this help page (for other languages see further)
What links here on Meta or from Meta · Wikipedia · MediaWiki
Reading
Go · Search · Namespace · Page name · Section · Backlinks · Redirect · Category · Image page · Special pages · Printable version
Tracking changes
Recent changes (enhanced) | Related changes · Watching pages · Diff · Page history · Edit summary · User contributions · Minor edit · Patrolled edit
Logging in and preferences
Logging in · Preferences
Editing
Starting a new page · Advanced editing · Editing FAQ · Export · Import · Shortcuts · Edit conflict · Page size
Referencing
Links · URL · Interwiki linking · Footnotes
Style and formatting
Wikitext examples · CSS · Reference card · HTML in wikitext · Formula · Lists · Table · Sorting · Colors · Images and file uploads
Fixing mistakes
Show preview · Reverting edits
Advanced functioning
Expansion · Template · Advanced templates · Parser function · Parameter default · Magic words · System message · Substitution · Array · Calculation · Transclusion
Others
Special characters · Renaming (moving) a page · Preparing a page for translation · Talk page · Signatures · Sandbox · Legal issues for editors
Other languages: