Template:Tt/doc: Difference between revisions

Template page
(Created page with "This template displays == Usage == <syntaxhighlight lang="html"> {{tt|Label| This is a tooltip box. It's used to provide a definition for jargon without forcing the player to look at another page. }} </syntaxhighlight> == Example == What is a {{tt|tooltip| This is a tooltip box. It's used to provide a definition for jargon without forcing the player to look at another page. }}?")
 
No edit summary
 
(5 intermediate revisions by the same user not shown)
Line 1: Line 1:
This template displays  
This template creates a tooltip, i.e. a label that displays more information when it's hovered.


== Usage ==
== Usage ==


<syntaxhighlight lang="html">
<syntaxhighlight lang="html">
{{tt|Label|
{{tt
This is a tooltip box.
|Tooltip
 
|This is a tooltip box.
It's used to provide a definition for [[jargon]] without forcing the player to look at another page.
|It's used to provide a definition for [[jargon]] without forcing the player to look at another page.
}}
}}
</syntaxhighlight>
</syntaxhighlight>
== Parameters ==
Parameters can't contain block elements or it'll break the layout. This is a tradeoff to allow the tooltip label to be inline.
{| class="wikitable col-1-center"
|-
! Parameter
! Description
|-
| <code>1</code>
| Label for the tooltip.
|-
| <code>2</code>
| First line in the tooltip body.
|-
| <code>3</code>
| Optional second line in the tooltip body.
|-
| <code>4</code>
| Optional third line in the tooltip body.
|}


== Example ==
== Example ==


What is a {{tt|tooltip|
What is a {{tt|Tooltip|This is a tooltip box.|It's used to provide a definition for [[jargon]] without forcing the player to look at another page.}}? Wow, that's {{tt|cool|Totally radical}}. We can have up to {{tt|three|One|Two|Three}} lines in the body.
This is a tooltip box.
 
It's used to provide a definition for [[jargon]] without forcing the player to look at another page.
}}?

Latest revision as of 07:56, 3 March 2024

This template creates a tooltip, i.e. a label that displays more information when it's hovered.

Usage

{{tt
|Tooltip
|This is a tooltip box.
|It's used to provide a definition for [[jargon]] without forcing the player to look at another page.
}}

Parameters

Parameters can't contain block elements or it'll break the layout. This is a tradeoff to allow the tooltip label to be inline.

Parameter Description
1 Label for the tooltip.
2 First line in the tooltip body.
3 Optional second line in the tooltip body.
4 Optional third line in the tooltip body.

Example

What is a Tooltip? Wow, that's cool. We can have up to three lines in the body.