Extension:CreateBox

From MediaWiki.org
Jump to: navigation, search
MediaWiki extensions manual
Crystal Clear action run.png
CreateBox

Release status: stable

Implementation Tag, Page action
Description Inputbox designed for page creation
Author(s) Ross McClure
Latest version 1.6 (2008-06-07)
MediaWiki 1.11+
License GNU General Public License 2.0 or later [1]
Download Template:WikimediaDownload/svn
Older version for pre-1.11 wikis
Example undefined.net
Hooks used
UnknownAction

ParserFirstCallInit

Translate the CreateBox extension if it is available at translatewiki.net

Check usage and version matrix; code metrics

CreateBox is a specialized version of Inputbox that focuses on page creation.

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.

Parameters[edit | edit source]

CreateBox handles parameters in the same manner as Inputbox. Example:

 <createbox>
 parameter1=value
 parameter2=value
 </createbox>

All parameters to CreateBox are optional:

  • align: Sets the alignment of the div which contains CreateBox. Defaults to center.
  • break: If set to "yes", this inserts a line break between the text field and button.
  • buttonlabel: Sets the text of the Create button.
  • default: Sets the default text of the input box.
  • editintro: Specifies a page title. The given page will be included prior to the submission form in the Edit screen.
  • prefix: Specifies a title fragment, which will prefix the submitted title.
  • preload: Specifies a page title. The contents of the given page will be preloaded into the submission form.
  • width: Sets the width of the input box.

Installation[edit | edit source]

  1. Download from SVN or the extension distributor.
  2. Create a folder called CreateBox and put the downloaded files in this folder.
  3. Extract the new folder to your extensions directory folder.
  4. Add
    require_once("{$IP}/extensions/CreateBox/CreateBox.php");
    
    to LocalSettings.php
  5. Test it with #Parameters and #MediaWiki messages.

Code[edit | edit source]

Download the code from SVN.

Optional Use[edit | edit source]

If you want a text box to show default text (without a button of any sort), just delete line 123 out of CreateBox.php

Uses could be to have a line of text too long but to be accessible by users (BBCode to copy and paste outside of wiki) without that text clogging up the page.

See also[edit | edit source]