This is an old revision of the document!
Table of Contents
Auto-Tooltip Plugin
Compatible with DokuWiki
greebo
This extension has not been updated in over 2 years. It may no longer be maintained or supported and may have compatibility issues.
Similar to tooltip
This syntax/helper plugin allows you to construct tooltips for text on the page, or to automatically generate tooltips based on a wikilink's title and abstract.
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.
Examples/Usage
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 a tooltip
<autott class1 class2>...</autott>
You can reference user-defined classes to style your tooltips differently. Class names are of the form plugin-autotooltip__MYNAME. For instance, to use the included “blue” example, create your tooltip like this:
<autott blue>...</autott>
And add this CSS:
.plugin-autotooltip-blue {background: rgba(0, 0, 40, 0.85);}
Generating a tooltip
<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.”
Helper Plugin
The helper exposes these methods:
forText
Create a manual tooltip.
$tooltip->forText($content, $tooltip, $title='', $preTitle='', $classes='', $textStyle='');
- $content: The on-page text.
- $tooltip: The tooltip content. Newlines will be rendered as line breaks.
- $title: The title inside the tooltip.
- $preTitle: Text to display before the title. Newlines will be rendered as line breaks.
- $classes: CSS classes to add to this tooltip.
- $textStyle - CSS styles for the linked content
forWikilink
Create a wikilink.
$tooltip->forWikilink($id, $content=null, $classes='', $linkStyle='');
- $id - A page id.
- $content - The on-page content. Newlines will be rendered as line breaks. Omit to use the page's title.
- $preTitle - Text to display before the title in the tooltip. Newlines will be rendered as line breaks.
- $classes - CSS classes to add to this tooltip.
- $linkStyle - Style attribute for the link.
Development
Change Log
- Work-around for DokuWiki Kaos bug in plugin.info.txt processing (2024-02-11 03:36)
- Work-around for DokuWiki Kaos bug in plugin.info.txt processing (2024-02-11 03:32)
- Fix harmless warnings from error log (2024-02-04 20:26)
- Fixed broken css classes (2024-01-15 19:04)
- Fixed #20 - Tooltip won't hide on fast mouse moves (2024-01-15 14:47)
- Code clean-up (2024-01-15 14:46)
- fix php 8 warnings (2024-01-07 20:24)
- Merge pull request #15 from Klap-in/patch-2 (2020-11-22 01:24)