Jump to content

Extension:Create Page

From mediawiki.org
(Redirected from Extension:CreatePage)
MediaWiki extensions manual
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)
Latest version 0.5.0 (2021-02-02)
MediaWiki 1.35+
PHP 7.3+
Database changes No
License GNU General Public License 3.0 or later
Download
README
RELEASE-NOTES
  • $wgCreatePageEditExisting
  • $wgCreatePageUseVisualEditor

The Create Page extension allows you to insert an input that takes the name of a new page into pages.

Installation

[edit]
  • Download and move the extracted CreatePage folder to your extensions/ directory.
    Developers and code contributors should install the extension from Git instead, using:cd extensions/
    git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/CreatePage
  • Add the following code at the bottom of your LocalSettings.php file:
    wfLoadExtension( 'CreatePage' );
    
  • Configure as required.
  • Yes Done – Navigate to Special:Version on your wiki to verify that the extension is successfully installed.

Configuration

[edit]
$wgCreatePageEditExisting
Defaults to false. Set to true to edit existing pages.
$wgCreatePageUseVisualEditor
Defaults to false. Set to true to redirect to VisualEditor for page creation.

Usage

[edit]

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

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

{{#createpage:}}

Create a page in the Course namespace:

{{#createpage:Course}}

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

{{#createpage:|Your page name}}

Altering the text of the submission button:

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

Specifying the default content for the page to be created:

{{#createpage:|||Template:ScaffoldTemplateNameHere}}

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}}

Authors

[edit]

This extension was written by Jeroen De Dauw as a Wikimedia Foundation contractor for the Wikipedia Education Program.

See also

[edit]