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

From Stoneshard wiki
Jump to navigation Jump to search
old>Realpsojed
(Added some documentation)
m (7 revisions imported)
 
(5 intermediate revisions by one other user not shown)
Line 1: Line 1:
{{Doc/start}}
{{Doc/start}}
This is a template created for use anytime you want to produce a pop-up mouseover tooltip. To see how this works, try to mouseover this link: [[Templar Sword]]. 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.
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 our most common usage is to load another template filled with formatted 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):
Usage: Create a new page, copy this code to the created page and fill in the parameters (or delete if you don't need both):


  <nowiki>{{ {{{1|Tooltip hover box}}}
  <nowiki>{{ {{{1|Tooltip hover box}}}
Line 9: Line 9:
}}</nowiki>
}}</nowiki>


For example, filling it like so


__TOC__
==Examples==
===Simply adding text===
  <nowiki>{{ {{{1|Tooltip hover box}}}
  <nowiki>{{ {{{1|Tooltip hover box}}}
|title= My page
|title= My page
Line 23: Line 27:
}}
}}


If you already have a page with data, you can load that data into the tooltip. For example, on the page [[Templar Sword]] the item stats are already displayed. We can call for this page's data by using


===Loading another page's contents===
Instead of writing text, links, etc. into the template, you can load the contents of an existing page. For example, to display whatever is written on the [[Vision/Tooltip]] page:
  <nowiki>{{ {{{1|Tooltip hover box}}}
  <nowiki>{{ {{{1|Tooltip hover box}}}
|title= {{:Templar Sword}}
|title= {{:Vision/Tooltip}}
}}</nowiki>
}}</nowiki>


Another option is to fill the data you want to see directly into the tooltip. In this example, we can use the [[Template:Weapon]] (or any other) and fill in the values.
{{ {{{1|Tooltip hover box}}}
|title= {{:Vision/Tooltip}}
}}
 
===Loading a part from another page's data structure===
If you have a page that uses our data structure, you can load only a certain part of it. For example, if I wanted to load the weapon's description from the [[Templar Sword]] page, then I can call for this page's description data by using the page name as in the previous example and providing the appropriate parameter. In this case, we can simply call for the Description parameter:


  <nowiki>{{ {{{1|Tooltip hover box}}}
  <nowiki>{{ {{{1|Tooltip hover box}}}
|title= {{Weapon
|title= {{:Templar Sword|Description}}
|WeaponType=Sword
}}</nowiki>
|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:
{{ {{{1|Tooltip hover box}}}
|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>
|title= {{:Templar Sword|Description}}
|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>


Both will produce this tooltip. Template:Weapon automatically sets the headline to the current page name, hence the "{{ROOTPAGENAME}}".
 
===Loading a Template===
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}}}
|title={{Quote|Be yourself; everyone else is already taken.|Oscar Wilde}}
}}</nowiki>


{{ {{{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>
===All of the above===
|Durability=150
Templates are very powerful tools that can do more fancy stuff. Check out these wiki pages where the above examples are fused together: [[Templar Sword]], [[Cleaving Strike]], [[Agrimony]], [[Bleeding]].
|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
}} }}


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


{{Doc/end}}
{{Doc/end}}

Latest revision as of 21:10, 21 November 2021

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 our most common usage is to load another template filled with formatted data.

Usage: Create a new page, 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=
}}



Examples

Simply adding text

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

will produce this result:

My page
Lorem ipsum dolor sit..


Loading another page's contents

Instead of writing text, links, etc. into the template, you can load the contents of an existing page. For example, to display whatever is written on the Vision/Tooltip page:

{{ {{{1|Tooltip hover box}}}
|title= {{:Vision/Tooltip}}
}}

Tooltip hover box

Loading a part from another page's data structure

If you have a page that uses our data structure, you can load only a certain part of it. For example, if I wanted to load the weapon's description from the Templar Sword page, then I can call for this page's description data by using the page name as in the previous example and providing the appropriate parameter. In this case, we can simply call for the Description parameter:

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


Loading a Template

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


All of the above

Templates are very powerful tools that can do more fancy stuff. Check out these wiki pages where the above examples are fused together: Templar Sword, Cleaving Strike, Agrimony, Bleeding.


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