Extension:MultiBoilerplate

From Linux Web Expert

The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.
MediaWiki extensions manual
MultiBoilerplate
Release status: stable
File: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) Robert Leverington, Dror S. [FFS] , Jhf2442
Latest version 2.2.1 (2022-02-09)
MediaWiki 1.35+
License GNU General Public License 2.0 or later
Download
README.md
CHANGELOG
  • $wgMultiBoilerplateOptions
  • $wgMultiBoilerplateOverwrite
Quarterly downloads Lua error in Module:Extension at line 172: bad argument #1 to 'inNamespace' (unrecognized namespace name 'skin').
Public wikis using Lua error in Module:Extension at line 172: bad argument #1 to 'inNamespace' (unrecognized namespace name 'skin').
Translate the MultiBoilerplate extension if it is available at translatewiki.net
Issues 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.md for more details.

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

Installation

  • <translate> [[<tvar name=2>Special:ExtensionDistributor/MultiBoilerplate</tvar>|Download]] and move the extracted <tvar name=name>MultiBoilerplate</tvar> folder to your <tvar name=ext>extensions/</tvar> directory.</translate>
    <translate> Developers and code contributors should install the extension [[<tvar name=git>Special:MyLanguage/Download from Git</tvar>|from Git]] instead, using:</translate>cd extensions/
    git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/MultiBoilerplate
  • <translate> Add the following code at the bottom of your <tvar name=1>LocalSettings.php </tvar> file:</translate>
    wfLoadExtension( 'MultiBoilerplate' );
    
  • Configure at your convenience - you must at least set up the boilerplates.
  • File:OOjs UI icon check-constructive.svg <translate> Done</translate> – <translate> Navigate to <tvar name=special>Special:Version</tvar> on your wiki to verify that the extension is successfully installed.</translate>

Configuration

Main configuration

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

  • $wgMultiBoilerplateOverwrite: false by default. If true, shows the boilerplates dropdown even on pre-existing pages. The selected boilerplate will completely overwrite the current contents.