Extension:MsWikiEditor

From MediaWiki.org
Jump to navigation Jump to search
MediaWiki extensions manual
Crystal Clear action run.svg
MsWikiEditor
Release status: stable
Implementation User interface
Description Easily add or remove buttons to the WikiEditor
Author(s) Martin Schwindl, Martin Keyler and Felipe Schenone
Latest version 3.0 (2016-02-04)
MediaWiki 1.21+
PHP 5.3+
License GNU General Public License 2.0 or later
Download
Parameters
  • $wgMSWE_buttons
  • $wgMSWE_add
  • $wgMSWE_remove
Hooks used
EditPage::showEditForm:initial
Translate the MsWikiEditor extension if it is available at translatewiki.net
Check usage and version matrix.

The MsWikiEditor extension allows you to easily add or remove buttons from the WikiEditor from your LocalSettings.php

Installation[edit]

  • Download and place the file(s) in a directory called MsWikiEditor in your extensions/ folder.
  • Add the following code at the bottom of your LocalSettings.php:
    wfLoadExtension( 'MsWikiEditor' );
    
  • Yes Done – Navigate to Special:Version on your wiki to verify that the extension is successfully installed.

To users running MediaWiki 1.24 or earlier:

The instructions above describe the new way of installing this extension using wfLoadExtension() If you need to install this extension on these earlier versions (MediaWiki 1.24 and earlier), instead of wfLoadExtension( 'MsWikiEditor' );, you need to use:

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

Usage[edit]

To add a button, add its definition to the $wgMSWE_add array in your LocalSettings.php. Here are a few examples:

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

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

$wgMSWE_remove = array( 'advanced', 'characters', 'help', 'file', 'reference', 'ilink', 'xlink' );

By default, both arrays are empty.

See also[edit]