CreatePage

Aus Free Software
Zur Navigation springen Zur Suche springen
Manual on MediaWiki Extensions
List of MediaWiki Extensions
Crystal Clear action run.png
CreatePage

Release status: stable

Implementation Special page
Description This extensions allows you to use normal redirects to redirect to external websites. This extension is part of the PerPageResources project.
Author(s) Mathias Ertl (Mati talk)
Version 1.0.2 (2010-10-27)
MediaWiki 1.13.0 or later (tested up to 1.18.1)
License GPL v3
Download see Download
CreatePage
CreatePage#Changelog
Parameters $wgCreatePageNamespaces, $wgCreatePageTypes
Example Special:Create page
Hooks used

ArticleAfterFetchContent
LangugeGetSpecialPageAliases

The CreatePage extension is a highly specialized extension designed specifically for vowi.fsinf.at. As with all MediaWikis, it is rather hard to create a new page and we even have a lengthy Help-page to describe the process. To make matters (a lot) worse, vowi.fsinf.at has a special naming-convention for all articles on which several of its features (i.e. SimilarNamedArticles) rely.

These two facts combined make it very hard for new users to create a new page. This extension is designed to fix just that. You just have to enter the right name (which, in our case, you know, if you want to write a new article) and some additional info and press "Create" to be redirected to a new page in edit-mode.

Note once again that this extension is highly specialized for its purpose and there is probably no other wiki were it is useful without modifications. The code is rather short, however, so feel free to take this extension as a template for new extensions.

Download

The source code of this extension is managed on GitHub. You can find the repository at mathiasertl/CreatePage. To get the most recent version of this extension, fetch the current HEAD:

git clone https://github.com/mathiasertl/CreatePage.git CreatePage

Older versions are marked as tags, you can view available tags with git tag -l and move back to the current HEAD with git checkout <tag-name>. Versions for older versions of MediaWiki, if available, are managed as branches, use git branch and git checkout <branch> to move to a specific branch. To move back to the newest version, use git checkout master.

Note that GitHub allows you to download older different commits as tarball if you do not want to install git.

Installation & configuration

Simply download the files into your extension-folder and include it in LocalSettings.php:

require_once("$IP/extensions/CreatePage/CreatePage.php");

# universities and course-types:
$wgCreatePageNamespaces = array(
        'Uni Wien' => 0,
        'TU Wien' => 1,
);
$wgCreatePageTypes = array(
        'EX' => 0,
        'LU' => 1,
        'PR' => 0,
);

Both arrays represent an option-list. The one element where the value is 1, will be the default selection. Take care that no more than one element is a default selection or else you will have invalid HTML.

Changelog

1.0.3
  • Remove TUWIS and use TISS instead.
1.0.2
  • Compatibility update for PHP 5.3
  • Minimum software requirement is now MediaWiki-1.13.0, because of the MWNamespace class.
1.0.1
  • Special:CreatePage is now in group "VoWi-Extensions" on Special:Specialpages
1.0.0
  • Fixed so that the special page works with all language/userlanguage combinations
  • Universities and types are now configurable with wgCreatePageNamespaces & $wgCreatePageTypes
  • Changed the example text to something shorter
0.9.2
  • Updated to work with MediaWiki 1.11.1 and later by fixing LanguageGetSpecialPageAliases (This was a typo in 1.11.0, see Bug 11462)
  • Updated link to this page (This wiki now uses Very short URLs)
0.9.1
  • A bug in version 0.9 broke the direct view of Special:Create Page. This is now fixed, with the special page now having its own parser object.
0.9
  • The extension now exclusively uses the addHTML function instead of the addWikiText function. This is required to get arround Bug 9762.
0.8.1
  • I now set the handler for the form correctly, so the page can now be included in another page
  • Updated the example for 'optional info' to no longer include a slash (since slashes in pagenames are somewhat problematic)
0.8

first version documented here

Licence

GPL v3 or any later version.