Table of Contents

Auto-Tooltip Plugin

Compatible with DokuWiki

  • 2024-02-06 "Kaos" yes
  • 2023-04-04 "Jack Jackrum" yes
  • 2022-07-31 "Igor" yes
  • 2020-07-29 "Hogfather" yes

plugin Manually create tooltips, or generate them off of the title and abstract of a wikilink

Last updated on
2024-02-10
Provides
Syntax, Helper, Action, Render
Repository
Source

Similar to tooltip

Tagged with abstract, tooltip

This plugin allows you to construct tooltips for text and links on the page, or to automatically generate tooltips based on a wikilink's title and abstract. If you enable the renderer plugin or install ActionRenderer, it can even add a tooltip to every internal wikilink on your site!

Installation

Install the plugin using the Plugin Manager and the download URL above, which points to latest version of the plugin. Refer to Plugins on how to install plugins manually.

Install both this plugin and Autolink 4. The configuration options for Autolink 4 allow you to specify text or regular expressions, and automatically turn those into links with tooltips.

If you're already using ActionRenderer as your renderer, this will happen automatically. Otherwise, Go to AdminConfigurationAdvancedrenderer_xhtml, and select “Auto-Tooltip.” Note that you can only have one custom renderer, so this is not compatible with other renderer plugins.

You can limit this to specific namespaces or pages using the configuration options.

You won't see tooltips on self-referential links. In other words, a link to wiki:whatever on wiki:whatever will not have a tooltip.

Examples/Usage

See these examples live.

Generating tooltip content automatically

<autott>wiki:syntax</autott>

This will generate a link to wiki:syntax, using the page's title as the link text. The tooltip will include the page's title and abstract.

<autott>wiki:syntax|Custom Title</autott>

Same as above, but the link text will be “Custom Title.”

Manual tooltips

<autott>
  <content>This is the linked text on the page.</content>
  <tip>The body of the tooltip.</tip>
  <title>An optional title for the tooltip</title>
</autott>

This creates a simple tooltip for text on the page.

Customizing appearance

<autott style1 style2>...</autott>

There is an admin setting to change the default styling of all tooltips. If you want to override that for a single tooltip, you can specify styles in the tooltip definition. Available classes are:

You can add additional styles in your CSS. Class names are of the form plugin-autotooltip__MYNAME. For instance, to create a tooltip with an image for a background and white text, add this CSS:

.plugin-autotooltip__picture {
  background: url(/path/to/image.jpg);
  color: #fff;
}

and then create your tooltip like this:

<autott picture>...</autott>

Configuration

Helper Plugin

The helper exposes these methods:

forText

Create a manual tooltip on arbitrary text.

$tooltip->forText($content, $tooltip, $title='', $preTitle='', $classes='', $textStyle='');

Create a wikilink with a tooltip.

$tooltip->forWikilink($id, $content=null, $classes='', $linkStyle='');

Compatibility

Development

Change Log

Discussion