Extension:Tooltips

From MediaWiki.org
Jump to: navigation, search
MediaWiki extensions manual - list
Crystal Clear action run.png
Tooltips

Release status: beta

220px
Implementation Tag
Description Add nice tooltips to wiki text
Author(s) Paul Grinberg, Stanislav Egorkin
Last version v0.0.1 (Feb. 13, 2011)
License GPL
Download link

Check usage (experimental)

This extension provides the ability to add nice tooltips to wiki text. This is remake of Extension:Tooltip by Paul Grinberg: javascript code was fully rewritten, design is completely new. Basic javascript was taken from Wowhead project and adapted for general needs.

Contents

[edit] Installation

[edit] Step 1

Download the extension code and place it in the extensions directory.

[edit] Step 2

Add the following text to your LocalSettings.php

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

[edit] Step 3

Replace in Parser.php:

if ( $isHTML ) { 
$text = "\n\n" . $this->insertStripItem( $text ); 
}

to

if ( $isHTML and $nowiki ) {
        $text = $this->insertStripItem( $text );
}
elseif ( $isHTML ) {
        $text = "\n\n" . $this->insertStripItem( $text ); 
}

[edit] Usage Instructions

There are two methods for using this extension in your wiki articles: via a Parser Function, and via a new Tag. These two methods are mutually exclusive and should NOT be interchanged on a given article in order to guarantee proper output.

[edit] <tooltip> Tag Format

Simply add the following text

<tooltip text="body text" image="link">tooltip text</tooltip>

directly inline with your article, where the "image=" (optional) is a name of the jpg image without '.jpg' (must be places in /extensions/Tooltip/images/).

[edit] {{#tooltip:}} Parser Function Format

Create a new Template called {{tooltip}} and add the following content to it

<includeonly>{{#tooltip: {{{1}}}|{{{2}}}}}|{{{3}}}</includeonly><noinclude>Usage: <nowiki>{{tooltip | base text | tooltip text | image}}</nowiki> ({{tooltip | base text | tooltip text}})</noinclude>

To use this extension on your wiki article, simply call the template like so

{{tooltip | base text | tooltip text | image }}
Personal tools
Namespaces

Variants
Actions
Navigation
Support
Download
Development
Communication
Print/export
Toolbox