Extension:MultiBoilerplate

From MediaWiki.org
Jump to: navigation, search
MediaWiki extensions manualManual:Extensions
Crystal Clear action run.png
MultiBoilerplate

Release status:Extension status stable

MultiBoilerplate Screenshot.png
ImplementationTemplate:Extension#type User interface
DescriptionTemplate:Extension#description Allows a boilerplate to be selected from a drop down box located above the edit form when editing pages.
Author(s)Template:Extension#username Robert Leverington, Dror S. [FFS] , Jhf2442
Latest versionTemplate:Extension#version 2.1.1 (2016-05-22)
MediaWikiTemplate:Extension#mediawiki 1.25+ (see #Mediawiki compatibility)
Database changesTemplate:Extension#needs-updatephp No
LicenseTemplate:Extension#license GNU General Public License 2.0 or later
Download
README
CHANGELOG
ParametersTemplate:Extension#parameters
  • $wgMultiBoilerplateOptions
  • $wgMultiBoilerplateOverwrite
  • $wgMultiBoilerplateDiplaySpecialPage
Hooks usedTemplate:Extension#hook
EditPage::showEditForm:initialManual:Hooks/EditPage::showEditForm:initial

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

Check usage and version matrix.

IssuesPhabricator

Open tasks · Report a bug

The MultiBoilerplate extension allows a boilerplate to be selected from a dropdown box located above the edit form. By default this shows only on creation of new pages. When loading a boilerplate, it will completely replace whatever text is already in the edit form. See README for more details.


The latest version is 2.1.1, released 2016-05-22. Click for complete release notes and changelog.

Since version 2.1.0, the extension uses the new Extension Registration that comes with MediaWiki 1.25 and so breaks compatibility with older versions.

Bugs and feature requests should be added to the extension's project page on Phabricator.

Installation[edit]

  • Download and place the file(s) in a directory called MultiBoilerplate in your extensions/ folder.
  • Add the following code at the bottom of your LocalSettings.php:
wfLoadExtension( 'MultiBoilerplate' );

To users running MediaWiki 1.24 or earlier:

The instructions above describe the new way of installing extensions using wfLoadExtension(), since MediaWiki 1.25. If you need to install this extension in earlier versions, instead of wfLoadExtension( 'MultiBoilerplate' );, you need to use:

require_once "$IP/extensions/MultiBoilerplate/MultiBoilerplate.php";

Configuration[edit]

Main configuration[edit]

The main configuration is of the available boilerplates; this is done in one of two ways:

  1. through $wgMultiBoilerplateOptions in LocalSettings.php, by filling the $wgMultiBoilerplateOptions array with a list of boilerplate names that correspond to templates, like so:
    $wgMultiBoilerplateOptions[ "My Boilerplate" ] = "Template:My Boilerplate";
    $wgMultiBoilerplateOptions[ "My Other Boilerplate" ] = "Template:My Other Boilerplate";
    
  2. Through system message MediaWiki:Multiboilerplate, which uses the following format:
    * My Boilerplate|Template:My Boilerplate
    

    Note: formatting the template entries as a list (i.e. including the leading asterisk) is required when using the MediaWiki:Multiboilerplate page. If this is not done, the entries will not be parsed properly and the templates will not show up. Headers (discussed below) are not required.

    You can also create headers inside the dropdown in order to separate boilerplates, by adding level 2 headers. For example:

    == Pretty Templates ==
    * My Boilerplate|Template:My Boilerplate
    == Ugly Templates ==
    * Their Boilerplate|Template:Their Boilerplate
    

Since version 2.1.1, it is possible to add wikilinks on this page without breaking the extension.

Additional configuration options[edit]

  • $wgMultiBoilerplateDiplaySpecialPage: false by default. if set to true, will add to the wiki a page named Special:Boilerplates that shows the currently configured boilerplates. This must be specified before the inclusion of the extension in LocalSettings.php (no longer true for v2.1.0).
  • $wgMultiBoilerplateOverwrite: false by default. If true, shows the boilerplates dropdown even on pre-existing pages. The selected boilerplate will completely overwrite the current contents.

MediaWiki compatibility[edit]

  • Version 2.1.0 only works MediaWiki 1.25+
  • Version 2.0.0 should work with MediaWiki 1.24+
  • Use 1.8.0 for MW <= 1.22