Help:Adding tooltips

From semantic-mediawiki.org
Jump to: navigation, search
Adding tooltips
Adding an icon with a tooltip
Further Information
Provided by: Semantic MediaWiki
Minimum version: 1.4.0
Maximum version: still supported
Function: yes
Tag: no
Name: #info
Table of Contents

The parser function #info allows to add tooltips containing additional information or warnings.

Syntax

{{#info: ''<text>'' | ''<icon>'' }}

Parameters

Text

The first parameter displays the text in the #info bubble and should only contain inline HTML elements. No paragraphs, tables, lists or any other block elements are allowed. One should also avoid using empty lines (because empty line will terminate one paragraph and start another one) and equal signs (see the tips section). Refraining from those guidelines could lead to incorrect HTML code and rendering (e. g. part of text after empty line could be rendered in the page, not in the bubble).

Icon

In case a second parameter is passed onto to #info, it will influences the display of the icon. If an incorrect parameter is used then the parameter will be silently ignored, and the default info icon will be displayed instead.

Allowed values are:

Icon Description Example
info A blue icon with question mark; default info.pngtest
warning A yellow icon with exclamation mark. warning.pngtest

CSS settings

Change display text CSS settings

// Change #info font text size
.smwtt {font-size: 0.5em;}

Examples

Code Result Comment
Some inline text{{#info:Text to be shown in a bubble.}} Some inline textinfo.pngText to be shown in a bubble. Click on the icon to see the bubble.
Tugrik{{#info:The official currency of Mongolia.}} Tugrikinfo.pngThe official currency of Mongolia.  
2011-02-29{{#info:Incorrect date.|warning}} 2011-02-29warning.pngIncorrect date. In Semantic MediaWiki prior to v1.6 the second argument is ignored, "info" icon is used unconditionally.

Related tips


This documentation page applies to all SMW versions from 1.6.0 to the most current version.
      Other languages: zh-hans

Help:Adding tooltips en 1.6.0


Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox