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)
  • Jeroen De Dauw,
  • Ike Hecht
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
Parameters
  • $wgCreatePageEditExisting
  • $wgCreatePageUseVisualEditor
Hooks used
  • ParserFirstCallInit
  • BeforePageDisplay
Translate the Create Page extension if it is available at translatewiki.net

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

Installation

  • Download and place the file(s) in a directory called CreatePage in your extensions/ folder.
  • 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

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

Usage

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.

{{#createpage:}}

Create a page in the Course namespace.

{{#createpage:Course}}

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

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

See also

This article is issued from Mediawiki. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.