Help:Tooltips
From WoWWiki
| HELP CONTENTS · Getting Started · New to WoWWiki · Editing WoWWiki · Editing WoWWiki (advanced) · The WoWWiki Community · Additional Help |
|---|
| See Wikia Help for general Wikia- and wiki- related help. See |
On WoWWiki, there are several important templates that work together in a unique way to show tooltips when you mouseover a link (assuming you have JavaScript support in your browser).
Because of these special relationships, this help page will try to go further in-depth on how to use these templates so they work well together.
Contents |
{{Item}}, {{Loot}} and {{Tooltip}}
- If you want an item link to show a tooltip, you need to use the {{item}} or {{loot}} template. NOTE
- Don't use {{item}} tooltip inside {{tooltip}} or {{settip}}.
To create a {{item}} link for an item, you can use the following format:
- The only parameter required is the name of the item.
- Include an |icon= argument to have an icon appear.
To create a {{loot}} link for an item, you can use the following format:
- The template name indicates the item is loot.
- The first argument is the quality of a given item (the exception is for enchants which should use "enchant").
- The second argument is the name of a given item's article.
- The third argument can be used to hide disambiguations, or different page names.
{{item}} Example Result {{loot}} Example Result {{item|<Frostmourne>}} [Frostmourne] {{loot|<Artifact>|<Frostmourne>}} [Frostmourne] {{item|<Warp Slicer>}} [Warp Slicer] {{loot|<Legendary>|<Warp Slicer>}} [Warp Slicer] {{item|<Azuresong Mageblade>}} [Azuresong Mageblade] {{loot|<Epic>|<Azuresong Mageblade>}} [Azuresong Mageblade] {{item|<Cruel Barb>}} [Cruel Barb] {{loot|<Rare>|<Cruel Barb>}} [Cruel Barb] {{item|<Archeus>|<icon=>}} [Archeus]
{{loot|<Uncommon>|<Archeus>}} [Archeus] {{item|<Linen Cloth>|<icon=>}} [Linen Cloth]
{{loot|<Common>|<Linen Cloth>}} [Linen Cloth] {{item|<Poor-quality item>}} [Cedar Walking Stick] {{loot|<Poor>|<Poor-quality item>}} [Cedar Walking Stick] {{loot|<enchant>|<Enchant Weapon - Fiery Weapon>}} [Enchant Weapon - Fiery Weapon]
If the item is on a disambiguation page, you can pass the page name as the second argument and the item name as the third argument:
{{item}} Example Result {{loot}} Example Result {{item|<Corruption (sword)>|<Corruption>}} [Corruption] {{loot|<Rare>|<Corruption (sword)>|<Corruption>}} [Corruption]
- If you want an item article to show a tooltip (and you know you do) when a loot or item link points to it, make sure to add a {{tooltip}} template with the following minimum parameters
To create a {{tooltip}} link for an item, you can use the following format:
- The template name indicates the item has a tooltip.
- The | mode= argument is a parameter value passed through from other templates.
- The | arg= argument is a parameter value passed through from other templates.
- The | name= argument is the name of the item in the game.
- The | quality= argument is the item quality, passed to {{quality}} to generate formatted item name.
- The | bind= argument is the binding type: BoE, BoU or BoP.
So at minimum the tooltip should look like this:
<onlyinclude>{{tooltip
| mode={{mode|}}
| arg={{arg|}}
| name=Cruel Barb
| quality=Rare
| bind=BoP
}}</onlyinclude>
A more expanded version:
<onlyinclude>{{{{{tpl|tooltip}}}
| mode={{mode|}}
| arg={{arg|}}
| icon=INV_Misc_Bag_11
| stack=20
| name=Candy Corn
| quality=Common
| bind=BoP
| ilvl=55
}}</onlyinclude>
- If you want an item article to show a tooltip of disenchanting results (see {{DE}}) when you mouse over the "item level" number, the following additional parameters are needed (slot and ilvl)
<onlyinclude>{{tooltip| mode={{mode|}}
| bind=BoP
| arg={{arg|}}
| name=Cruel Barb
| quality=Rare
| slot=One-Hand
| ilvl=24
}}</onlyinclude>
So on the tooltip box on the item page you would see (mouse over the "24"): Item Level 24
See Template:Tooltip/doc for complete details on all the various parameters to fill out a complete tooltip.
- Things not to do
- Don't make the width wider than 18em. The maximum supported width for hover tooltips is TBD.
- Don't put extra linebreaks in your parameter contents:
- Bad:
- | attrib=+4 Strength<br/>
- +3 Agility<br/>
- +5 Stamina
- Good:
- | attrib=+4 Strength<br/>+3 Agility<br/>+5 Stamina
- Bad:
- If an item article does not have a tooltip or the tooltip is improperly formatted or missing required parameters, the tooltip will show an error
- Example (move your mouse pointer over the link)
- You can use the following item to test the contents of various {{tooltip}} parameters
{{Mob}}
To show the image and basic info for a mob in a tooltip, use {{Mob}} to link to the mob page. This template just passes info to the {{NPC}} template below (faction= is always "Combat").
To create an {{Mob}} link for an mob, you can use the following format:
- The template name indicates the target article is about a NPC.
- The first argument is the name of the NPC's article.
- The second argument is the title of the NPC.
Example Result {{Mob|Alexander Calder|Warlock Trainer}} Alexander Calder <Warlock Trainer>
{{Mob|Lord Victor Nefarius|Lord of Blackrock|level=??+}} [??+] Lord Victor Nefarius <Lord of Blackrock>
Like {{NPC}}, for the {{Mob}} tooltip to work, a completed {{Npcbox}} needs to be in the target mob's page. {{Mobbox}} was used in the past, but has since been deleted. {{Npcbox}} should be used instead.
{{NPC}} and {{Npcbox}}
To show the image and basic info for an NPC or mob, use {{NPC}} to link to the NPC page.
To create an {{NPC}} link for an NPC, you can use the following format:
- The template name indicates the target article is about a NPC.
- The first argument is the faction the NPC belongs to (Alliance, Horde, or Neutral).
- The second argument is the name of the NPC's article.
- The third argument is the title of the NPC.
Example Result {{NPC|Alliance|Alexander Calder|Warlock Trainer}} Alexander Calder <Warlock Trainer>
{{NPC||Andormu|Keepers of Time|level=70+}} [70+] Andormu <Keepers of Time>
For the {{NPC}} tooltip to work, a completed {{Npcbox}} needs to be in the target NPC's page.
- Example {{Npcbox}}
{{npcbox
| name = Alexander Calder
| image = Alexander Calder.jpg
| title = Warlock Trainer
| level = 60
| type =
| faction = Alliance
| city =
| race = Human
| creature = Humanoid
| sex = Male
| location = [[Ironforge]]
| relatives = [[Amelia Calder|Amelia]] (sister), [[Deze Snowbane]] (cousin)
| status = Alive
}}
{{Quest}}, {{Questlong}}, or {{Questclass}}; and {{Questbox}}
The {{Quest}}, {{Questlong}}, or {{Questclass}} templates create varying types of quest links that display tooltip with a subset of quest info from data in the {{Questbox}} of the target quest.
Example Result {{quest|Divino-matic Rod}}Divino-matic Rod {{questlong|Neutral|47D|Divino-matic Rod}}[47D] Divino-matic Rod
{{questclass|Neutral|Warlock|60G|Suppression}}![]()
[60G] Suppression
For the {{Quest}}, {{Questlong}}, or {{Questclass}} templates to work, the target quest must contain a completed {{Questbox}} template.
- Example {{Questbox}}
{{questbox
| name = Suppression
| faction = Neutral
| level = 60
| levelreq = 60
| class = warlock
| type = Group
| category = Blasted Lands
| start = {{NPC|Neutral|Daio the Decrepit|level=60}}
| experience = 650
| rewards = {{loot|rare|Tome of Sacrifice}}
| id = 7583
}}
{{Coords}}
This template creates a superscript link to a page with the name of the 3rd (map) parameter and shows a tooltip of the corresponding map with a marker (
) for where the coordinates are on the map.
Example Result {{coords|54|51|Stormwind}} [54, 51] {{coords|56|75|Durotar}} [55.8, 75.3]
For a list of map names to use, see Template:Coords/Maps.
How it works
The templates work in combination with a collection of Javascript to load the box, tooltip, or other relevant data for display. The mechanism was developed by Pcj.
