Extension:MsInsert

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

Release status:Extension status stable

ImplementationTemplate:Extension#type User interface
DescriptionTemplate:Extension#description Adds a dropdown menu for inserting into the editor the content of certain pages
Author(s)Template:Extension#username Martin Schwindl, Martin Keyler and Felipe Schenone
Latest versionTemplate:Extension#version 3.1 (2016-02-04)
MediaWikiTemplate:Extension#mediawiki 1.21+
PHPTemplate:Extension#php 5.3+
LicenseTemplate:Extension#license GPLv2+
Download
ParametersTemplate:Extension#parameters

$wgTemplates

Hooks usedTemplate:Extension#hook
EditPage::showEditForm:initialManual:Hooks/EditPage::showEditForm:initial

Translate the MsInsert extension if it is available at translatewiki.net

Check usage and version matrix.

The MsInsert extension adds a dropdown menu to the editor (both the WikiEditor and the regular editor), that allows you to insert into the wikitext the content of any wiki page listed in the dropdown menu. The wiki pages are added to the dropdown menu from LocalSettings.php

Installation[edit]

  • Download and place the file(s) in a directory called MsInsert in your extensions/ folder.
  • Add the following code at the bottom of your LocalSettings.php:
    wfLoadExtension( 'MsInsert' );
    
  • 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( 'MsInsert' );, you need to use:

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

Configuration[edit]

To add a page to the dropdown menu, add it to the $wgTemplates array in your LocalSettings.php, like so:

$wgTemplates = array( 'Template:Test', 'Main Page', 'Talk:Main Page' );

Or alternatively:

$wgTemplates[] = 'Template:Test';
$wgTemplates[] = 'Main Page';
$wgTemplates[] = 'Talk:Main Page';

If the page does not exist yet, then it will not be added to the dropdown menu, even if it's listed in the $wgTemplates array. By default, the array is empty.

Usage[edit]

Once a page has been added to the $wgTemplates, it will appear listed in the dropdown menu whenever you edit a page. By selecting it in the dropdown menu, the extension will fetch its contents and insert them into the wikitext, wherever you had the cursor.

See also[edit]