Difference between revisions of "Template:Tooltip hover box/doc"

From Stoneshard wiki
Jump to navigation Jump to search
old>Realpsojed
(updated)
old>Realpsojed
(Rewritten help for templates and pages.)
Line 23: Line 23:
}}
}}


If you already have a page with data, you can load that data into the tooltip. For example, if I had some data I want to see in the tooltip on page [[Templar Sword]], then I can call for this page's data by using
 
If you already have a page with data, you can load that data into the tooltip. For example, if I want to see the weapon description from the [[Templar Sword]] page, then I can call for this page's data by using the page name (and appropriate parameter if needed). In this case, Templar Sword page uses parameters, so we can simply call for Description.


  <nowiki>{{ {{{1|Tooltip hover box}}}
  <nowiki>{{ {{{1|Tooltip hover box}}}
|title= {{:Templar Sword}}
|title= {{:Templar Sword|Description}}
}}</nowiki>
}}</nowiki>


Another option is to fill the data into another template. In this example, we will use the [[Template:Weapon]] and fill in the values:
{{ {{{1|Tooltip hover box}}}
|title= {{:Templar Sword|Description}}
}}
 
 
Another option is to fill the tooltip box with another template. In this example, we will use the [[Template:Quote]] and fill in the values Quote and Author:


  <nowiki>{{ {{{1|Tooltip hover box}}}
  <nowiki>{{ {{{1|Tooltip hover box}}}
|title= {{Weapon
|title={{Quote|Be yourself; everyone else is already taken.|Oscar Wilde}}
|WeaponType=Sword
|Damage=37 Slashing<br> 2 Sacred
|Properties=Armor Damage:<br> Armor Piercing:<br> Bodypart Damage:<br> Block Chance:<br> Fumble Chance:<br> Accuracy:<br> Crit Chance:<br> Skills Energy Cost:
|Values= <span style="color:green;">'''+15%'''</span><br> <span style="color:green;">'''+20%'''</span><br> <span style="color:green;">'''+15%'''</span><br> <span style="color:green;">'''+10%'''</span><br> <span style="color:green;">'''-5%'''</span><br> <span style="color:green;">'''+5%'''</span><br> <span style="color:green;">'''+5%'''</span><br> <span style="color:darkred;">'''+15%'''</span>
|Durability=150
|Description=There is a faint etching on the surface of the blade, pledging loyalty to the Host and the court... the common kind of court.
|Price=6500
}}
}}</nowiki>
}}</nowiki>
And this is the result. Formatting from this template and from Template:Weapon is both applied. Note that Template:Weapon automatically sets the headline to the current page name, hence "{{ROOTPAGENAME}}" is shown on this page.


{{ {{{1|Tooltip hover box}}}
{{ {{{1|Tooltip hover box}}}
|title= {{Weapon
|title={{Quote|Be yourself; everyone else is already taken.|Oscar Wilde}}
|WeaponType=Sword
|Damage=37 Slashing<br> 2 Sacred
|Properties=Armor Damage:<br> Armor Piercing:<br> Bodypart Damage:<br> Block Chance:<br> Fumble Chance:<br> Accuracy:<br> Crit Chance:<br> Skills Energy Cost:
|Values= <span style="color:green;">'''+15%'''</span><br> <span style="color:green;">'''+20%'''</span><br> <span style="color:green;">'''+15%'''</span><br> <span style="color:green;">'''+10%'''</span><br> <span style="color:green;">'''-5%'''</span><br> <span style="color:green;">'''+5%'''</span><br> <span style="color:green;">'''+5%'''</span><br> <span style="color:darkred;">'''+15%'''</span>
|Durability=150
|Description=There is a faint etching on the surface of the blade, pledging loyalty to the Host and the court... the common kind of court.
|Price=6500
}}
}}
}}



Revision as of 19:20, 11 May 2020

Template-info.png Documentation

This is a template created for use anytime you want to produce a pop-up mouseover tooltip. The tooltip automatically provides CSS styling and border similar to the in-game windows. Tooltip can display anything you write into the template, but the most common usage is to provide another template filled with data.

Usage: Create a new page with the name <something>/Tooltip. For example Templar Sword/Tooltip. Copy this code to the created page and fill in the parameters (or delete if you don't need both):

{{ {{{1|Tooltip hover box}}}
|title=
|body=
}}

For example, filling it like so

{{ {{{1|Tooltip hover box}}}
|title= My page
|body= <br>Lorem ipsum dolor sit..
}}

will produce this result:

My page
Lorem ipsum dolor sit..


If you already have a page with data, you can load that data into the tooltip. For example, if I want to see the weapon description from the Templar Sword page, then I can call for this page's data by using the page name (and appropriate parameter if needed). In this case, Templar Sword page uses parameters, so we can simply call for Description.

{{ {{{1|Tooltip hover box}}}
|title= {{:Templar Sword|Description}}
}}


Another option is to fill the tooltip box with another template. In this example, we will use the Template:Quote and fill in the values Quote and Author:

{{ {{{1|Tooltip hover box}}}
|title={{Quote|Be yourself; everyone else is already taken.|Oscar Wilde}}
}}
Be yourself; everyone else is already taken.
~ Oscar Wilde

For more help, please use the discussion for this template Template_talk:Tooltip hover box.