Extension:MsWikiEditor

Category:Extensions without an imageCategory:Extensions without a compatibility policyCategory:GPL licensed extensions
MediaWiki extensions manual
MsWikiEditor
Release status: stableCategory:Stable extensions
Implementation User interfaceCategory:User interface extensions
Description Easily add or remove buttons to the WikiEditor
Author(s) Martin Schwindl, Martin Keyler
Maintainer(s) Sophivorus
Latest version 4.0 (2024-08-12)
MediaWiki 1.39+Category:Extensions with manual MediaWiki version
PHP 7.4+
License GNU General Public License 2.0 or later
Download Category:Extensions in Wikimedia version control
  • $wgMSWE_remove
  • $wgMSWE_add
Quarterly downloads 5 (Ranked 106th)
Translate the MsWikiEditor extension if it is available at translatewiki.net
Category:All extensions

The MsWikiEditor extension allows you to easily add or remove buttons from the WikiEditor toolbar via configuration.

Installation

  • Download and move the extracted MsWikiEditor folder to your extensions/ directory.
    Developers and code contributors should install the extension from Git instead, using:cd extensions/
    git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/MsWikiEditor
  • Add the following code at the bottom of your LocalSettings.php file:
    wfLoadExtension( 'MsWikiEditor' );
    
  • Configure as required.
  • Yes Done – Navigate to Special:Version on your wiki to verify that the extension is successfully installed.

Configuration

To add a button, add its definition to the $wgMSWE_add array in your LocalSettings.php file using the following format:

$wgMSWE_add['button-key'] = [ 'Name of the button', 'Default content', 'Left wrapper', 'Right wrapper', 'URL or path to the image', 'toolbar-section', 'section-group' ];

If the toolbar section and section group are not specified, the button will be added to the "insert" group of the "main" section. Here are a few working examples:

$wgMSWE_add['date'] = [ 'Current date', date( 'Y-m-d' ), '', '', '/w/extensions/MsWikiEditor/images/date.png' ];
$wgMSWE_add['gallery'] = [ 'Gallery', '<gallery>\\n', 'File:Example1.jpg|Caption1\\nFile:Example2.png|Caption2\\n', '</gallery>', '/w/extensions/MsWikiEditor/images/gallery.png' ];
$wgMSWE_add['strike'] = [ 'Strike', '<strike>', 'Text', '</strike>', '/w/extensions/MsWikiEditor/images/strike.png' ];
$wgMSWE_add['email'] = [ 'Email', '[mailto:', 'address@example.com', ']', '/w/extensions/MsWikiEditor/images/email.png' ];
$wgMSWE_add['mslink'] = [ 'MsLink', '{{#l:', 'Filename.ext', '}}', '/w/extensions/MsWikiEditor/images/link.png' ];
$wgMSWE_add['template'] = [ 'Your template', '{{Your template|', 'Parameters', '}}', '/w/extensions/MsWikiEditor/images/template.png' ];
$wgMSWE_add['signature'] = [ 'Signature', '--~~~~', '', '', '/w/extensions/MsWikiEditor/images/signature.png' ];
$wgMSWE_add['attention'] = [ 'Attention', '{{Attention|', 'Text', '}}', '/w/extensions/MsWikiEditor/images/attention.png' ];

To remove a button, include its key (the 'rel' attribute) in the $wgMSWE_remove array. For example:

$wgMSWE_remove = [ 'advanced', 'characters', 'help', 'file', 'reference', 'ilink', 'xlink' ];

By default, both arrays are empty.

See also

Category:All extensions Category:EditPage::showEditForm:initial extensions Category:Extensions in Wikimedia version control Category:Extensions with manual MediaWiki version Category:Extensions without a compatibility policy Category:Extensions without an image Category:GPL licensed extensions Category:ResourceLoaderGetConfigVars extensions Category:Stable extensions Category:User interface extensions