Extension:Tooltip

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

Release status:Extension status unmaintained

Tooltip with transparency.png
ImplementationTemplate:Extension#type Tag
DescriptionTemplate:Extension#description Add fancy tooltips to wiki text
Author(s)Template:Extension#username Paul Grinberg
Latest versionTemplate:Extension#version v0.6.0 (2008-01-14)
LicenseTemplate:Extension#license No license specified
Download Template:WikimediaDownload/svn

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

Check usage and version matrix.

This extension provides the ability to add fancy tooltips to wiki text. Unlike other extensions which provide similar functionality (i.e. Extension:Glossary (outdated), Extension:LinkedImage (outdated), Extension:LinkFloatie, etc), this extension allows for multi-line wiki and/or HTML syntax text for the tooltip. Additionally, the tooltip itself is displayed in a fancy semitransparent window. Unfortunately, this extension does not work in conjunction with Extension:Glossary.


Installation Instructions[edit]

Step 1[edit]

Download the extension code from SVN and place it in the extensions directory.
Newer version is on discussion page.

Step 2[edit]

Add the following text to your LocalSettings.php

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

Step 3[edit]

Save a 16x16 pixel png with some level of alpha channel transparency as ttbg.png in $wgScriptPath/images directory. As an example, here is a blue background image.

Usage Instructions[edit]

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.

<tooltip> Tag Format[edit]

Simply add the following text

<tooltip text="body text" x=xoffset y=yoffset>tooltip text</tooltip>

directly inline with your article, where the x= and y= parameters are optional.

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

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

<includeonly>{{#tooltip: {{{1}}}|{{{2}}}}}</includeonly><noinclude>Usage: <nowiki>{{tooltip | base text | tooltip text}}</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}}

Note: You can also modify the template wih the x= and y= parameters as optional parameters 3 and 4.

Revisions[edit]

  • v0.7.6 - August 2014, Source is on discussion page
  • v0.5.2 - January 14, 2008 - Another small bug fix (clean up warning)
  • v0.5.1 - December 05, 2007 - Small bug fix (clean up warning)
  • v0.5 - December 03, 2007 - Numerous style improvements and cleanup (many thanks to Eclecticdave and Lexw)
  • v0.4.1 - November 27, 2007 - Better parser function support.
  • v0.4 - November 26, 2007 - Added a parser function in addition to the tag
  • v0.3.1 - November 21, 2007 - Better placement of the tooltip (thanks to User:Lexw)
  • v0.2 - August 22, 2007 - Better wiki syntax parsing
  • v0.1 - August 22, 2007 - Initial Revision

See also[edit]