Memory Alpha
Advertisement
Memory Alpha
Help Contents → Inputbox

The InputBox extension is a MediaWiki extension that allows you to add predefined HTML forms to Memory Alpha pages. It was originally created for the purpose of adding a "Create an article" box to Wikinews.

This was extended to the CreateBox extension that focuses on page creation only. If a user were to attempt to create a page that already exists, InputBox allows the user do so, and disregards any preloaded content or edit introductions. CreateBox, by contrast, directs the user to an error page where they can enter a different page name, and all specified properties are preserved.

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 Example
type=search
Generates a search box with a default width of 50 characters. The button labels can be specified, see below; defaults are MediaWiki:Tryexact and MediaWiki:Searchfulltext. The text field specifies the search criteria.
createbox

<createbox> </createbox>

Allows creating a new page. The button label can be specified, see below; default is 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 is also used in the sidebar of the "Standard" skin. The text field specifies which page is to be edited.

Parameters[]

Parameter
Scope
Example
bgcolor=
All types

Sets the table background color (HTML color values). Do not use quotes.
<inputbox>
type=search
bgcolor=#000000
</inputbox>
width=
All types

Sets the width of the inputbox in characters.
<createbox>
width=24
</createbox>

<createbox> width=24 </createbox>

default=
All types

Default text to put in the inputbox.
<inputbox>
type=comment
default=User talk:Eloquence
</inputbox>
preload=
comment, createbox

The page under this title will be preloaded (see below) into the blank editbox when a new page is created.
<createbox>
preload=MediaWiki:Editthispage
</createbox>

<createbox> preload=MediaWiki:Editthispage </createbox>

Enter the title of a non-existent page in the example createbox 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 submission form for new pages.
<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>
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 createbox and the button(s). Defaults to using the line break unless set to no.
<createbox>
width=24
break=no
</createbox>

<createbox> width=24 break=no </createbox>

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 gives an edit page. Applying comment for a new page works, if the page already exists editintro is ignored.

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 and templates are not supported in inputbox parameters.

Preload[]

Preloading can be done with an inputbox (see above), but also with a URL like https://meta.wikimedia.org/wiki/abc?action=edit&preload=Template:Preload_demo which links to the edit box of a new page, preloaded with {{Preload demo}}.

The wikitext of the preloaded page, including noinclude parts and tags but excluding includeonly tags, is loaded into the editbox if the target page does not exist yet. If the target of the preload operation already exists, then only its wikitext is loaded; the preload command is ignored.

Advertisement