Extension:MakeArticle

From MediaWiki.org
Jump to: navigation, search


MediaWiki extensions manual - list
Crystal Clear action run.png
makearticle

Release status: beta

Implementation Tag
Description Given the name of a template page generates a form that the user can populate with values of the template's parameters; when the hit the 'create' button, generates a new page, with name of their choice, based on the parameterised template
Author(s) Julian Douglas St Michael Porter (julianportertalk)
Last version 0.1 (9 November 2010)
MediaWiki 1.16.0
PHP 5.3.2 or later
License GPL
Download Source Code
README
Tags
<makearticle>
Hooks used
ParserFirstCallInit

UnknownAction

Check usage and version matrix

Contents

What can this extension do? [edit]

Say you have defined a template, Template:MyTemplate which contains a number of parameters. Adding the following to a page:

<makearticle> Template:MyTemplate </makearticle>

will generate a form which lets you specify values for:

  • A page name
  • Each of the parameters in Template:MyTemplate

When you click on the 'create' button you are taken to a newly created page with the specified name and based Template:MyTemplate populated with the values you specified. So the extension provides a simple user interface for creating pages from parameterised templates.

What this means is that this extension is a more flexible version of extensions like CreateArticle, in that it can work with any template, and parses the template on the fly to determine what fields there are in it that the user needs to fill in.

Usage [edit]

<makearticle> Template:MyTemplate </makearticle>

Where Template:MyTemplate is a parameterised template.

Installation [edit]

To install this extension:

  1. Place the downloaded file makearticle.tar.gz in the folder $IP/extensions, where $IP is the configuration variable defined in LocalSettings.php that points to the root of your MediaWiki install.
  2. Uncompress and extract the archive, resulting in the creation of a folder $IP/extensions/makearticle containing two files:
    • makearticle.php
    • Style.css
  3. Add the following to LocalSettings.php:
require_once("$IP/extensions/makearticle/makearticle.php");

See also [edit]

I would like to acknowledge the authors of the following extensions, as they were extremely useful to me as a source of ideas while I was developing the extension:

  • CreateArticle by Lisa Ridley, from which I took the basic approach.
  • PageCSS by Ævar Arnfjörð Bjarmason, from which I took the code to inject a stylesheet into the page containing the form.