Extension:MultiBoilerplate

From MediaWiki.org
Jump to: navigation, search


MediaWiki extensions manual
Crystal Clear action run.png
MultiBoilerplate

Release status: stable

MultiBoilerplate Screenshot.png
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) Dror S. [FFS] , Robert Leverington (RobertLtalk)
Latest version 2.0.0alpha for MW >= 1.24
1.8.0 for MW <= 1.22 (2015-02-06)
MediaWiki 1.11 or higher
Database changes No
License GNU General Public License 2.0 or later
Download
#Releases
Hooks used
EditPage::showEditForm:initial

Translate the MultiBoilerplate extension if it is available at translatewiki.net

Check usage and version matrix; code metrics

Issues:

Open tasks · Report a bug

The MultiBoilerplate extension allows a boilerplate to be selected from a drop down box located above the edit form when editing non-existent 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 the extension's project page on Phabricator.

Installation[edit | edit source]

  1. Check out all extension files and place them in a MultiBoilerplate subdirectory within your MediaWiki extensions directory.
  2. Add require_once( "$IP/extensions/MultiBoilerplate/MultiBoilerplate.php" ); to LocalSettings.php.
  3. Enjoy!

Usage[edit | edit source]

Use LocalSettings.php to configure MultiBoilerplate.

  • To list the boilerplate pages:
$wgMultiBoilerplateOptions[ "My Boilerplate" ] = "Template:My Boilerplate";
$wgMultiBoilerplateOptions[ "My Other Boilerplate" ] = "Template:My Other Boilerplate";
$wgMultiBoilerplateOptions[ "Yet Another Boilerplate" ] = "Template:Yet Another Boilerplate";
  • Alternative is:
$wgMultiBoilerplateOptions = false;

and use the MediaWiki:Multiboilerplate page to list boilerplate pages with the following format: * Name | Template
Example:

* My Boilerplate | Template:My Boilerplate
* My Other Boilerplate | Template:My Other Boilerplate
* Yet Another Boilerplate | Template:Yet Another Boilerplate
  • You can set whether or not the selection box is displayed on pages that already exist (default is false):
$wgMultiBoilerplateOverwrite = true;
  • An includable special page Special:boilerplates can be added that displays a list of boilerplates.
$wgMultiBoilerplateDiplaySpecialPage = true;

Releases[edit | edit source]

Version Release date Comments
2.0.0alpha 2015-02-06
  • Updated for MW >= 1.24
  • Refactored to modern extension standards
  • Now handles <onlyinclude>
  • Breaking changes:
    • Not compatible with with MW < 1.24
    • $wgMultiBoilerplateDiplaySpecialPage must now be place before the inclusion (require_once) of the extension to take effect
1.8.0 2009-07-31 Optional special page
1.7 2009-04-08 Get boilerplates from content message when used, instead of user language message.
1.6 2008-02-26
  • Added README.
  • ltrim() now used instead of preg_replace().
1.5 2008-02-06 Now handles <noinclude> and<includeonly> tags.
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.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.2 2008-01-07 Refactor code, fix major bug that made the extension useless and add comments.
1.1 2007-12-18 Original version.

See also[edit | edit source]