Preloader MediaWiki Extension
This repository has been archived on 2024-03-20. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
Find a file
tengel 9b7b7526ab Some modernization & code cleanup
* Move the Preloader class into its own file + add $wgAutoloadClasses entry
* Coding style tweaks, as per MediaWiki's coding conventions
* Converted from PHP-based i18n to JSON i18n
* Version 1.3 with the appropriate changelog entries and whatnot
* Deprecated Preloader.php (but didn't fully remove it yet) in favor of extension.json -- MediaWiki 1.25 or newer is now required for this extension
* Added myself into authors
* Changed the Special:Version URL back to MediaWiki.org as it should be the canonical location for extension (and skin etc.) documentation; since this is an updated version of [[mw:Extension:Preloader]] it should be no problem to update that page to point to the correct repository etc.
* Tweak the README file to account for new MW requirements + extension loading method
* Fix $wgPreloaderSource so that it works again ( HT @legoktm )
2024-03-20 09:20:41 -05:00
i18n Some modernization & code cleanup 2024-03-20 09:20:41 -05:00
CHANGELOG.md Some modernization & code cleanup 2024-03-20 09:20:41 -05:00
composer.json Add composer.json (fixes #1) 2024-03-20 09:20:41 -05:00
extension.json Some modernization & code cleanup 2024-03-20 09:20:41 -05:00
LICENSE update copyrights, version 2024-03-20 09:20:41 -05:00
Preloader.class.php Some modernization & code cleanup 2024-03-20 09:20:41 -05:00
Preloader.php Some modernization & code cleanup 2024-03-20 09:20:41 -05:00
README.md Some modernization & code cleanup 2024-03-20 09:20:41 -05:00

Preloader MediaWiki Extension

See http://www.mediawiki.org/wiki/Extension:Preloader

Overview

  1. Introduction
  2. Requirements
  3. Installation
  4. Configuration
  5. Boilerplate
  6. Feedback

1. Introduction

The Preloader extension allows the creation of boilerplate text which will be inserted into the edit form when creating new pages. Different boilerplate text can be specified for different namespaces.

This extension supports the standard <includeonly> and <noinclude> tags in the boilerplate text.

2. Requirements

The Preloader extension requires MediaWiki 1.25.0 or later.

3. Installation

Git - clone the GitHub repository into your extensions subdirectory:

cd /path/to/wiki/extensions
git clone https://github.com/troyengel/Preloader/

Composer - the package is available via Composer / Packagist:

Then edit your LocalSettings.php file and add the following line:

wfLoadExtension( 'Preloader' );

Installation can be verified through the Special:Version page on your wiki.

4. Configuration

Configuration of the boilerplate sources is done via the $wgPreloaderSource configuration variable, which takes the following format:

$wgPreloaderSource[<namespace index>] = PAGE TITLE;

For instance:

$wgPreloaderSource[NS_MAIN] = 'Template:Boilerplate';
$wgPreloaderSource[NS_HELP] = 'Template:Boilerplate help';

...indicates that the boilerplate text for pages in the main namespace should be loaded from Template:Boilerplate, while pages in the Help namespace will be preloaded from Template:Boilerplate_help. Other namespaces have no boilerplate configured.

5. Boilerplate

Using the above example configuration, create the wiki page Template:Boilerplate and use the standard include tags to indicate which parts are the template and which are the generic wiki text:

<includeonly>
__TOC__

== Overview ==

[[Category:MyDefaultCategory]]
</includeonly>
<noinclude>
This template is included by the Preloader extension on new article creation.
</noinclude>

When this template is included into a new wiki page, only this text is included and ready to edit:

__TOC__

== Overview ==

[[Category:MyDefaultCategory]]

6. Feedback

Please submit comments, suggestions and bug reports to https://github.com/troyengel/Preloader/.