Open main menu

Extension:Include WP

MediaWiki extensions manual
OOjs UI icon advanced.svg
Include WP
Release status: unmaintained
Implementation Tag , Parser function , API
Description IncludeWP is a lightweight extension for including Wikipedia content into your wiki.
Author(s) Jeroen De Dauwtalk
Latest version 0.1 (2011-02-13)
MediaWiki 1.16+
PHP 5.2+
Database changes No
License GNU General Public License 3.0 or later
Download Stable releases - All releases
Translate the Include WP extension if it is available at translatewiki.net
Check usage and version matrix.

The Include WP is a lightweight extension for including Wikipedia content into your wiki.

Contents

Feature overviewEdit

  • Include articles from Wikipedia or any other MediaWiki wiki into your pages.
  • Show only a limited amount of paragraphs on page load, with an option to show the full article.
  • Partial conversion to plain-text.
    • Removal of templates (such as infoboxes), ref tags, comments, categories and images.
    • Both internal and external links are rendered as plain-text.
    • Tables, lists, table of content, section headers and more are retained.
  • Usage of the MediaWiki Resource Loader when available with backward support for MW 1.16.x.

DownloadEdit

You can find the current version of Include WP on the Google Code download page, as well as a list of legacy downloads.

The extension can be retrieved directly from Git [?]:

  • WP/ Browse code
  • Some extensions have tags for stable releases.
  • Each branch is associated with a past MediaWiki release. There is also a "master" branch containing the latest alpha version (might require an alpha version of MediaWiki).

Extract the snapshot and place it in the extensions/Include WP/ directory of your MediaWiki installation.

If you are familiar with git and have shell access to your server, you can also obtain the extension as follows:

cd extensions/
git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/Include+WP.git

IncludeWP requires Validator 0.4.2 or above in order to work. A compatible copy of Validator always comes bundled with the regular releases, and is automatically loaded by IncludeWP, so you do not need to worry about it when using one of these. If you are getting the code from SVN, make sure you also get a copy of Validator (see here for instructions).

Note: it no longer works with Validator 0.5 or later.

InstallationEdit

Once you have downloaded the code, place the IncludeWP and Validator directories within your MediaWiki 'extensions' directory. Then add the following code to your LocalSettings.php file:

# IncludeWP
require_once( "$wgExtensionAssetsPath/IncludeWP/IncludeWP.php" );

ConfigurationEdit

Configuration of IncludeWP is done by adding simple PHP statements to your LocalSettings.php file. These statements need to be placed AFTER the inclusion of IncludeWP. The options are listed below and their default is set in the Include WP settings file. You should NOT modify the settings file, but can have a look at it to get an idea of how to use the settings, in case the below descriptions do not suffice.

TODO

UsageEdit

Description: Parser hook that allows displaying content of a Wikipedia article.

Implemented as both parser function and as tag extension.

ParametersEdit

# Parameter Aliases Type Default Description
1 page - Text required The name of the (remote) page you want to display.
2 wiki - Text wikipedia The name of the wiki you want to pull content from. Needs to be one of the allowed wikis, by default only wikipedia.
- paragraphs - Whole number 3 The number of paragraphs you want to initially display.
- height - Whole number 0 The max height (in px) of the div into which the content is loaded. Set to 0 for no limit.

SyntaxEdit

Tag extension with only the required parameters.

<include page="{Text}" />

Tag extension with all parameters.

<include page="{Text}" wiki="{Text}" paragraphs="{Whole number}" height="{Whole number}" />

Tag extension with all parameters using the default parameter notation.

<include wiki="{Text}" paragraphs="{Whole number}" height="{Whole number}">{page, Text}</include>

Parser function with only the required parameters.

{{#include:page={Text}}}

Parser function with all parameters.

{{#include:
page={Text}
| wiki={Text}
| paragraphs={Whole number}
| height={Whole number}
}}

Parser function with all parameters using the default parameter notation.

{{#include:
{page, Text}
| {wiki, Text}
| paragraphs=Whole number
| height=Whole number
}}

VersionEdit

This is a copy of the release notes file on SVN, which might be more up to date then this page.

Version 0.1Edit

2011-02-13

  • Initial release

CompatibilityEdit

  • Media Wiki v. 1.29 - This Extension uses WfMsg() which is changed to WfMessage()

Possible improvementsEdit

  • Make the call to the remote API from the local API module. Currently the client makes a call to the remote API and then sends that to the local API, which is likely slower then the other approach.

InternationalizationEdit

Include WP is fully internationalized. Translation of Include WP messages is done through translatewiki.net. The translation for this extension can be found here. To add language values or change existing ones, you should create an account on translatewiki.net, then request permission from the administrators to translate a certain language or languages on this page (this is a very simple process). Once you have permission for a given language, you can log in and add or edit whatever messages you want to in that language.

AuthorsEdit

Include WP has been written by Jeroen De Dauw.

ScreenshotsEdit

See alsoEdit