GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Main page
  • Get MediaWiki
  • Get extensions
  • Tech blog
  • Contribute
  • User help
  • FAQ
  • Technical manual
  • Support desk
  • Communication
  • Developer portal
  • Code statistics
  • Community portal
  • Recent changes

This view

  • Original page
  • New address

GeezerVison is showing www.mediawiki.org — Extension:AutoCreatePage - MediaWiki

MediaWiki extensions manual
AutoCreatePage
Release status: stable
Implementation Parser function
Description Provides a parser function to create additional pages automatically when a page is saved
Author(s)
  • Markus Krötzsch
  • Daniel Herzig
  • Universal Omega
Latest version 1.0.0 (2026-07-30)
MediaWiki 1.39+
PHP 8.1+
Database changes No
Parameters

  • $egAutoCreatePageMaxRecursion
  • $egAutoCreatePageIgnoreEmptyTitle
  • $egAutoCreatePageNamespaces
Hooks used
  • ParserFirstCallInit
  • RevisionDataUpdates
Licence GNU General Public License 2.0 or later
Download
GitHub:
  • project page
  • git repository URL
  • commit history

Note:
No localisation updates are
provided by translatewiki.net .


README.md

The AutoCreatePage extension provides a parser function called #createpageifnotex: that creates a page of a given title if no such page exists yet. The function takes the page title and the wikitext that is used to create the page as its only parameters. This can be used by templates that want to create some content on separate pages, which is especially useful when creating pages with Page Forms or when using Semantic MediaWiki to create query pages (which may be too big to fit on the same page).

The original repository of this extension is apparently unmaintained.

Usage

The general syntax for using the parser function is:

{{#createpageifnotex:
 Name of the page to create
 |Initial content of the page if created
}}

All newly created pages will be attributed to the user who edited the page where the parser function was used. It is possible to use templates and parser functions as part of the initial content by surrounding them with ‎<nowiki> tags. Example:

{{#createpageifnotex:
 Name of the page to create
 |<nowiki>{{TemplateName|parameter=value}}</nowiki>
}}

However, newly created pages can never create additional pages (this is a feature; otherwise one could accidentally create large numbers of pages, where each new page creates another one).

Pages are only created if the parser function is used on a page in one of MediaWiki's content namespaces. Nothing will happen if the parser function is called on, e.g., template pages.

Installation

  • Download and place the file(s) in a directory called AutoCreatePage in your extensions/ folder.
  • Add the following code at the bottom of your LocalSettings.php file:
    wfLoadExtension( 'AutoCreatePage' );
    
  • Configure as required.
  • Yes Done – Navigate to Special:Version on your wiki to verify that the extension is successfully installed.

Configuration

The extension supports three configuration variables, that can be set in the "LocalSettings.php" file.

$wgAutoCreatePageMaxRecursion
The maximum recursion depth to which calls of createpageifnotex are executed on created pages. Default: 1.
$wgAutoCreatePageIgnoreEmptyTitle
If invocations of createpageifnotex should be silently ignored. Default: false (will put an error message on the wiki page).
$wgAutoCreatePageIgnoreEmptyContent
If invocations of createpageifnoconent should be silently ignored. Default: false (will put an error message on the wiki page).
$wgAutoCreatePageNamespaces
The list of namespaces in which calls of createpageifnotex are executed. If your call originates from a page not in one of these namespaces, it gets ignored. Defaults to $wgContentNamespaces . An example for an alternative setting:
$wgAutoCreatePageNamespaces = [
    NS_MAIN,
    NS_USER,
    NS_TEMPLATE,
    NS_CUSTOM
];

See also

  • Extension:Create Page - Allows placing an input that takes the name of a new page into pages.
  • Extension:InputBox - Allows users to add predefined HTML forms to wiki pages
  • Extension:CreatePageUw - Adds a form via a special page to create a new page
This extension is included in the following wiki farms/hosts and/or packages:
  • ProWiki
Retrieved from "https://www.mediawiki.org/w/index.php?title=Extension:AutoCreatePage&oldid=8649476"
Categories:
  • Stable extensions
  • Parser function extensions
  • ParserFirstCallInit extensions
  • RevisionDataUpdates extensions
  • GPL licensed extensions
  • Extensions in GitHub version control
  • All extensions
  • Extensions included in ProWiki
  • Page creation extensions
Hidden categories:
  • Extensions without an image
  • Extensions without a compatibility policy
  • Extensions with manual MediaWiki version
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.