Extension:AutoCreatePage

The AutoCreatePage extension provides a parser function called " " 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).

Usage
The complete documentation is avaiable on the GitHub page of the extension. The general syntax for using the parser function is:

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 tags. Example:

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).

Configuration
The extension supports three configuration variables, that can be set in the "LocalSettings.php" file.
 * The maximum recursion depth to which calls of createpageifnotex are executed on created pages. Default:.
 * The maximum recursion depth to which calls of createpageifnotex are executed on created pages. Default:.


 * If invocations of createpageifnotex should be silently ignored. Default:  (will put an error message on the wiki page).
 * If invocations of createpageifnotex should be silently ignored. Default:  (will put an error message on the wiki page).


 * 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 . An example for an alternative setting:
 * 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 . An example for an alternative setting:

Version history

 * Version 0.6 (2016-10-13): New config variable
 * Version 0.5 (2016-05-13): New config variables  and
 * Version 0.4 (2014-09-23): Initial release, based on previous code by Daniel Herzig (from AIFB Portal extension version 0.3).