DokuWiki

It's better when it's simple

User Tools

Site Tools


plugin:autotooltip

This is an old revision of the document!


Auto-Tooltip Plugin

Compatible with DokuWiki

greebo

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

Last updated on
2018-12-21
Provides
Syntax, Helper
Repository
Source

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

Tagged with abstract, 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

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

Discussion

plugin/autotooltip.1545398770.txt.gz · Last modified: 2018-12-21 14:26 by zioth

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki