Extension:MsWikiEditor
Appearance
MsWikiEditor Release status: stable |
|
---|---|
Implementation | User interface |
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+ |
PHP | 7.4+ |
License | GNU General Public License 2.0 or later |
Download | |
|
|
Quarterly downloads | 9 (Ranked 126th) |
Translate the MsWikiEditor extension if it is available at translatewiki.net | |
The MsWikiEditor extension allows you to easily add or remove buttons from the WikiEditor toolbar via configuration.
Installation
[edit]- Download and move the extracted
MsWikiEditor
folder to yourextensions/
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.
- Done – Navigate to Special:Version on your wiki to verify that the extension is successfully installed.
Configuration
[edit]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' ), '', '', 'extensions/MsWikiEditor/images/date.png' ];
$wgMSWE_add['gallery'] = [ 'Gallery', '<gallery>\\n', 'File:Example1.jpg|Caption1\\nFile:Example2.png|Caption2\\n', '</gallery>', 'extensions/MsWikiEditor/images/gallery.png' ];
$wgMSWE_add['strike'] = [ 'Strike', '<strike>', 'Text', '</strike>', 'extensions/MsWikiEditor/images/strike.png' ];
$wgMSWE_add['email'] = [ 'Email', '[mailto:', 'address@domain.com', ']', 'extensions/MsWikiEditor/images/email.png' ];
$wgMSWE_add['mslink'] = [ 'MsLink', '{{#l:', 'Filename.ext', '}}', 'extensions/MsWikiEditor/images/link.png' ];
$wgMSWE_add['template'] = [ 'Your template', '{{Your template|', 'Parameters', '}}', 'extensions/MsWikiEditor/images/template.png' ];
$wgMSWE_add['signature'] = [ 'Signature', '--~~~~', '', '', 'extensions/MsWikiEditor/images/signature.png' ];
$wgMSWE_add['attention'] = [ 'Attention', '{{Attention|', 'Text', '}}', '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.