Extension:MsWikiEditor

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

Release status:Extension status stable

ImplementationTemplate:Extension#type User interface
DescriptionTemplate:Extension#description Easily add or remove buttons to the WikiEditor
Author(s)Template:Extension#username Martin Schwindl, Martin Keyler and Felipe Schenone
Latest versionTemplate:Extension#version 3.0 (2016-02-04)
MediaWikiTemplate:Extension#mediawiki 1.21+
PHPTemplate:Extension#php 5.3+
LicenseTemplate:Extension#license GPLv2+
Download
ParametersTemplate:Extension#parameters
  • $wgMSWE_buttons
  • $wgMSWE_add
  • $wgMSWE_remove
Hooks usedTemplate:Extension#hook
EditPage::showEditForm:initialManual:Hooks/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' );
    
  • YesY 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]