This site is supported by donations to The OEIS Foundation.
Template:Tooltip
[⧼Purge⧽ Template:Tooltip]
The {{tooltip}} OEIS Wiki user interface template shows a tooltip with tooltip text when the user mouse hovers over the corresponding base text (under which a dotted line appears).
FEATURE: Use _base text or preferably _base text_ to automatically turn it into a wiki link, e.g. base text. (Do not use the automatic link creation feature if base_text itself contains any underscore!)
NOTE: Many web browsers (such as Firefox, Google Chrome, Internet Explorer, Opera, Safari) show tooltip text as a tooltip when the user mouse hovers over base text. However, this behavior is not guaranteed and should not be relied on.
Contents
Usage
- {{tooltip|base text|tooltip text}}
or (to automatically turn base text into the wiki link base text)
- {{tooltip|_base text_|tooltip text}}
where
- First argument: base text, which shows as text on the page; or _base text_, which shows as linked text on the page;
- Second argument: tooltip text, which shows as a tooltip when the user mouse hovers over base text (under which a dotted line appears).
More semantically specific templates
To show a tooltip with expanded text of an abbreviation, you should use the more semantically specific template
- {{abbr|abbreviation}}
which accesses a "database" to automatically generate the expanded text for many abbreviations.
To show a tooltip with translated text, you should use the more semantically specific template
- {{translation|original text|translated text}}
which currently redirects to this template (so it doesn't automatically translate anything yet...).
Examples
Examples with valid input
Code Result Comment {{tooltip|Riemann Hypothesis}} Riemann Hypothesis {{tooltip|Riemann Hypothesis|RH}} Riemann Hypothesis [[Riemann Hypothesis|{{tooltip|Riemann Hypothesis|RH}}]] Riemann Hypothesis {{tooltip|_Riemann Hypothesis_}} Riemann Hypothesis {{tooltip|_Riemann Hypothesis_|RH}} Riemann Hypothesis {{tooltip|_Riemann Hypothesis|RH}} Riemann Hypothesis {{tooltip|sum of prime factors|sopf}} sum of prime factors [[sopf(n)|{{tooltip|sum of prime factors|sopf}}]] sum of prime factors {{tooltip|A000098|{{Sequence/list/names|A000098}}}}[1] A000098 {{tooltip|A000099|{{Sequence/list/names|A000099}}}}[1] A000099 (Title truncated: vertical pipe not allowed in title!)
Examples with invalid input
Code Result {{tooltip||}} Tooltip error: No base text provided! {{tooltip|}} Tooltip error: No base text provided! {{tooltip}} Tooltip error: No base text provided!
Code
<noinclude>{{documentation}}</noinclude><includeonly><!-- FEATURE: Surround 'base text' with underscores, e.g. '_base text_' to turn it into a wiki link, e.g. [[base text]]. (You can't use this feature (automatic link creation) if 'base_text' contains underscores.) NOTE: < replaced by < in title (otherwise < breaks things up!) > replaced by > in title (otherwise > breaks things up!) -->{{#if: {{{1|}}} | {{#ifeq: {{#pos:{{{1|}}}|_}} | 0 | [[{{#replace:{{{1|}}}|_}}|<!-- --><span style="border-bottom: 1px dotted #999;" title="{{#replace:{{#replace:{{{2|{{#replace:{{{1|}}}|_}}}}}|<|<}}|>|>}}">{{#replace:{{{1|}}}|_}}</span><!-- -->]] | <span style="border-bottom: 1px dotted #999;" title="{{#replace:{{#replace:{{{2|{{#replace:{{{1|}}}|_}}}}}|<|<}}|>|>}}">{{{1|}}}</span> }} | {{error| Tooltip error: No base text provided! }} }}</includeonly>