Extension:Create Page

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

Release status: beta

Implementation Parser function, User interface
Description Allows placing an input that takes the name of a new page into pages.
Author(s) Jeroen De Dauw, Ike Hecht
Latest version 0.4 (2013-02-23)
MediaWiki 1.18.0 or higher
PHP 5.3 or above
Database changes No
License GNU General Public License 3.0 or later
Download See below
release notes

$wgCreatePageEditExisting, $wgCreatePageUseVisualEditor

Translate the Create Page extension if it is available at translatewiki.net

Check usage and version matrix; code metrics


Open tasks · Report a bug

Requirements[edit | edit source]

Create Page requires:

  • MediaWiki 1.18 or above - autocomplete requires version 1.25
  • PHP 5.3 or above

Download[edit | edit source]

The extension can be retrieved directly from Git [?]:

  • Browse code
  • Some extensions have tags for stable releases.
  • Each branch is associated with a past MediaWiki release. There is also a "master" branch containing the latest alpha version (might require an alpha version of MediaWiki).

Extract the snapshot and place it in the extensions/CreatePage/ directory of your MediaWiki installation.

If you are familiar with git and have shell access to your server, you can also obtain the extension as follows:

cd extensions/
git clone https://gerrit.wikimedia.org/r/p/mediawiki/extensions/CreatePage.git

Installation[edit | edit source]

Once you have downloaded the code, place the CreatePage directory within your MediaWiki 'extensions' directory. Then add the following code to your LocalSettings.php file:

# Create Page
require_once( "$IP/extensions/CreatePage/CreatePage.php" );

Configuration parameters[edit | edit source]

Defaults to false. Set to true to edit existing pages.
Set to true to redirect to VisualEditor for page creation..

Usage[edit | edit source]

The input is placed using the #createpage parser function. It accepts 3 optional arguments. Namespace, default page name and submission button text, in that order.

Most simple usage, which will send the user to ?title=enteredPageName&action=edit&redlink=1, ie create enteredPageName if it does not exist yet.


Create a page in the Course namespace.


A regularly behaving input, but with "Your page name" entered as default value.

{{#createpage:|Your page name}}

Altering the text of the submission button.

{{#createpage:||Create this page!}}

Specifying default content for the page to be created.

{{#createpage:|||Add some content here}}

Display the input on the same line as some text.

<p style="display:inline">Enter the name for a new course:</p> {{#createpage:Course||Create course}}

Version[edit | edit source]

This is a copy of the release notes file on git, which might be more up to date then this page.

These are the release notes for the Create Page extension.

Version 0.4[edit | edit source]


  • Added $wgCreatePageEditExisting variable.
  • Added $wgCreatePageUseVisualEditor variable.
  • Added autocomplete to input field.

Version 0.2[edit | edit source]


  • Added 4th parameter to add intial text to the created page.
  • Use of wfMessage rather then wfMsg.
  • Explicit references to globals in entry point file.

Version 0.1[edit | edit source]


Initial release.

Internationalization[edit | edit source]

Create Page is fully internationalized. Translation of Create Page messages is done through translatewiki.net. The translation for this extension can be found here. To add language values or change existing ones, you should create an account on translatewiki.net, then request permission from the administrators to translate a certain language or languages on this page (this is a very simple process). Once you have permission for a given language, you can log in and add or edit whatever messages you want to in that language.

Authors[edit | edit source]

Create Page has been written by Jeroen De Dauw as Wikimedia Foundation contractor for the Wikipedia Education Program.

Screenshots[edit | edit source]

External links[edit | edit source]

See also[edit | edit source]