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

From Stoneshard wiki
Jump to navigation Jump to search
old>Realpsojed
(Rewritten help for templates and pages.)
m (7 revisions imported)
 
(2 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. 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 24: Line 28:




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.
===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}}}
|title= {{:Vision/Tooltip}}
}}</nowiki>
 
{{ {{{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}}}
Line 35: Line 50:




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:
===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}}}
  <nowiki>{{ {{{1|Tooltip hover box}}}
Line 44: Line 60:
|title={{Quote|Be yourself; everyone else is already taken.|Oscar Wilde}}
|title={{Quote|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]].
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.