Template:New MediaWiki tag extension

InfoDabble > Tech Notes > MediaWiki > New MediaWiki tag extension
Jump to: navigation, search
Use this template for creating a new MediaWiki tag extension called NAME. See Manual:Tag extensions

***Use subst: for Template:New MediaWiki extension below***

This is a MediaWiki Extension
NAME

Release status: beta

Type: Parser extension
Description: .
Author: Eric Hartwell
Version: 0.5
MediaWiki: Tested on
Download: Code (this article)

Contents

[edit] What can this extension do?

This project is still under development.

[edit] Usage

[edit] Installation

[edit] Parameters

[edit] Changes to LocalSettings.php

require_once("$IP/extensions/NAME/NAME.php");

[edit] Code

<?php
/**
 * NAME.php
 * This Extension does .......
 * written by Eric Hartwell  http://www.ehartwell.com/about
 * To activate the functionality of this extension include the following in your
 * LocalSettings.php file:
 * require_once('$IP/extensions/NAME/NAME.php');
 */
if(! defined( 'MEDIAWIKI' ) ) {
   echo( "This is an extension to the MediaWiki package and cannot be run standalone.\n" );
   die( -1 );
} else {
 
// Replace validextensionclass with: specialpage, parserhook, variable (multiple functionality), other
$wgExtensionCredits['validextensionclass'][] = array(
     'name' => 'NAME',
     'author' =>'Eric Hartwell', 
     'url' => 'http://www.ehartwell.com',
     'description' => 'This Extension is an example and performs no discernable function',
    );
 
$wgExtensionFunctions[] = 'efNAMESetup';
 
function efNAMESetup() {
    global $wgParser;
    $wgParser->setHook( 'NAME', 'efNAMERender' );
}
 
function efNAMERender( $input, $args, $parser ) {
    // Nothing exciting here, just escape the user-provided
    // input and throw it back out again
    return htmlspecialchars( $input );
}
?>


[edit] See also