Extension:MultiBoilerplate

From MediaWiki.org

Jump to: navigation, search
Manual on MediaWiki Extensions
List of MediaWiki Extensions
MultiBoilerplate

Release status: stable

Implementation User interface
Description Allows a boilerplate to be selected from a drop down box located above the edit form when editing pages.
Author(s) MinuteElectron Talk
Version 1.6
MediaWiki 1.11 or higher
License GNU General Public License 2.0 or later
Download Source Code
README
#Releases
Hooks used

EditPage::showEditForm:initial

The MultiBoilerplate extension allows a boilerplate to be selected from a drop down box located above the edit form when editing non-existant pages or optionally (based upon configuration variable $wgMultiBoilerplateOverwrite), load the template over the current contents. Any data inside <noinclude></noinclude> tags will not be loaded, and any data inside <includeonly></includeonly> will only be included (and the tags are stripped before include).

Bugs and feature requests should be added to MediaZilla under the 'MediaWiki extensions' product and 'MultiBoilerplate' component.

Contents

[edit] Installation

  1. Place the MultiBoilerplate.php source code into extensions/MultiBoilerplate/MultiBoilerplate.php.
  2. Place the MultiBoilerplate.i18n.php source code into extensions/MultiBoilerplate/MultiBoilerplate.i18n.php.
  3. Add require_once( "$IP/extensions/MultiBoilerplate/MultiBoilerplate.php" ); to LocalSettings.php.
  4. Enjoy!

[edit] Usage

Fill the $wgMultiBoilerplateOptions variable with a list of boilerplate names to templates.

$wgMultiBoilerplateOptions[ "My Boilerplate" ] = "Template:My Boilerplate";

Alternatively set the variable to false and use the MediaWiki:Multiboilerplate page to set options.

LocalSettings.php:
$wgMultiBoilerplateOptions = false;
MediaWiki:Multiboilerplate:
* My Boilerplate|Template:My Boilerplate

Optionally set whether or not the selection box is displayed on pages that already exist (defaults to false) using $wgMultiBoilerplateOverwrite.

$wgMultiBoilerplateOverwrite = true;

[edit] Releases

Version Release date Comments
1.1 2007-12-18 Original version.
1.2 2008-01-07 Refactor code, fix major bug that made the extension useless and add comments.
1.3 2008-01-19 Use Xml:: instead of manually created HTML, converted all double-quotes to single-quotes, added an optional message multiboilerplate-label to display a label before the drop-down box, and rename multiboilerplate-select to multiboilerplate-legend and multiboilerplate-load to multiboilerplate-submit to be less ambiguous.
1.4 2008-02-06
  • It is now (optionally) possible to specify boilerplates in a MediaWiki namespace message instead of a LocalSettings.php configuration variable.
  • The extension now uses descriptionmsg (allowing description internationalisation).
  • Part of the code that used direct database interfacing to check for article existence has been replaced with a call to the $wgTitle global.
  • The $wgMultiBoilerplateThings global has been renamed to $wgMultiBoilerplateOptions for a greater level of self-explanation.
  • The boilerplate selection box is no longer displayed if there are no options.
  • Version number incremented from 1.3 to 1.4.
1.5 2008-02-06 Now handles <noinclude> and<includeonly> tags.
1.6 2008-02-26
  • Added README.
  • ltrim() now used instead of preg_replace().

[edit] See Also

Personal tools