Help:Tooltips

Current status
The tooltip system described on this page is currently active, but is a beta feature. Please report any issues you may encounter on the |talk page.

Normally, tooltip systems on wikis draw their data from data mining sites, but it sounds unlikely that there will be any of these for Neverwinter. Instead, we're looking at setting up a tooltip system that will draw its data from the wiki itself.

On the main content page
To enable the tooltip system to more smoothly load data, tooltip data should not be included directly on their associated pages. Instead, include Tooltip section on the main page for an item, ability, or other entity that has a tooltip.

Example
A Soiled Tunic is the first chest armor piece acquired by Trickster Rogues.

Quests

 * Signs of Life: found during quest

If the tooltip data page doesn't currently exist, the tooltip section will automatically display a link and instructions for creating the page. Otherwise, it will display the actual tooltip data and a link for editing it.

Creating the data page
For a given page, its data page is included on the "/Tooltip" subpage. For example, the tooltip data for Help:Tooltips example is at Help:Tooltips example/Tooltip.

Once the page is open for editing, add this to the page:

Add the tooltip content between |body= and the }} at the bottom.

The title
Normally, the |title= line can be left as is. But assume that you're creating a page for an item called "Unstoppable Force" and there is a quest also called "Unstoppable Force". Thus, you've had to name the item page "Unstoppable Force (weapon)". The tooltip will end up displaying "Unstoppable Force (weapon)", which won't match the in-game text.

To fix this, change the |title= line to |title=Unstoppable Force. The title will still appear incorrectly while the data is loaded, but it will be corrected as soon as the data loads.

Tooltip content style guidelines
Tooltip content has some differences in style guidelines from regular page content because the tooltips are meant to emulate the in-game look.
 * Don't use links in tooltip content.
 * They are usually redundant on the pages where the tooltip appears, and when the tooltip is displayed when hovering over a link, the links in the tooltip can't be used anyway. Usually, the only thing they do is disrupt the formatting.
 * For the same reason, don't use the item template. That template is intended for regular page content only.
 * Don't define custom colors. Use the color classes to the right to help maintain consistency across the wiki.
 * if there are missing colors, please provide a screenshot on the talk page of a tooltip with the missing color and we'll add it as soon as possible.

Common Elements
Common elements present in tooltips may include any of the following. or

474-580 Damage

AC  Power Critical Strike Recovery Defense

Defense Slot: Empty Offense Slot: Empty Utility Slot: Empty Armor Enhancement Slot: Empty Weapon Enhancement Slot: Empty

Requires Class: Devoted Cleric Requires Level: 60 1 60 43

Updating tooltip data
All you have to do is edit the tooltip page as you would any other wiki page. Just maintain the correct structure.

Displaying the hover tooltips
Once you've done the above, there's nothing more you need to do. '''But note that the system requires Javascript to function. You won't see any hover tooltips if you have Javascript disabled.''' For those of you using a NoScript extension, the Javascript in question comes from gamepedia.com.

Caching
But note that the tooltip system only looks for links that need tooltips when you load a page. If a tooltip page is added for an page that didn't previously have one, you need to refresh the page.

Also, the tooltip system caches data in your browser when it first loads it on a page. When you hover over a link to a page with tooltip data, the system tries to load it then. For example, if there is a link on "Unstoppable Force (quest)" to "Unstoppable Force (weapon)", the first time you hover the cursor over any link to "Unstoppable Force (weapon)", it will load the data for "Unstoppable Force (weapon)" and cache it in the page. You won't see any changes until you refresh or in some other way reload the page to clear its cache.

The cache is specific not just to which page you have loaded, but is also limited to the tab or window the page is opened in. If you have "Unstoppable Force" open in two different tabs, each has its own cache for tooltip data.

Using tooltip data in pages
You can display tooltips in pages by treating the tooltip data pages like templates. For example, to show a tooltip for Unstoppable Force (weapon), you'd just include the following in a page:

If the tooltip page has been correctly created, it will automatically use Tooltip page box to layout the data.

You can specify a different template if you wish. This works as follows:

to use Tooltip float right instead, which places the tooltip at the right and causes page content to wrap around it.

Framework
The tooltip system is mostly comprised of Javascript located on MediaWiki:Common.js, but Tooltip hover box and Tooltip hover box loading are used to format the data. There are also styles in MediaWiki:Hydradark.css that affect the appearance of tooltips and their contents.