Forum index > Tooltips
I know this has been discussed before, but no action taken, so I figure I'll try to get this working. Basically we'll want to duplicate the tooltips by Pcj found on Wowpedia. If an admin can copy this (from
// See Help:Tooltips through
function ttMouseOver() ) into MediaWiki:Common.js, I can work on trying to implement it into our various templates. -- 17:46, 5 December 2011 (UTC)
Tooltips are now functional; thank you to both Pcj and Alianin for getting this working.
I do have a question about their implementation: is there any way to modify the tootips' appearance without altering the basic infoboxes? Right now the tooltip displays an article's entire infobox, which is big, clunky, and highly intrusive. Our infoboxes contain a lot of information that is simply not needed in a tooltip. Is it possible to scale these tooltips back and define a unique appearance for them? -- Heaven's Agent 18:02, 15 December 2011 (UTC)
- I think I understand enough of how it was implemented to make the changes. What would we like to include? --
22:13, 15 December 2011 (UTC)
- Yeah, you just put whatever you want displayed (and styled however you want) after the main template in a <div style="display:none;" class="tooltip-content"></div> and that should do what you want. --Pcj 23:47, 15 December 2011 (UTC)
- For items I think all info should be included, but the template should be scaled back. Font size can be reduced, line breaks removed, width reduced. Maybe even reduce the icon size, though that might require altering how icons are defined in articles that use the template.
- For missions we could list mission name, level, planet, starting NPC, and ending NPC. We don't really need to include faction or class restrictions since that should be part of the missionlink anyway, but we might also want to consider image indicators for these variables as well. -- Heaven's Agent 19:22, 17 December 2011 (UTC)
- Actually, after thinking about it I'm not sure an icon needs to be included in item tooltips at all. In most cases the itemlink will be accompanied by the icon(s) anyway. -- Heaven's Agent 16:48, 18 December 2011 (UTC)
I made an attempt to implement a formatted item tooltip. I think I misunderstood Pcj's instructions; the results I was getting were all over the board: I had the tooltip included in the item article, I had the text of the item article hidden, I had the entire item article used as a tooltip, etc.
The code I used can be found in my Sandbox. I'm done working with this for today, though I do intend to come back to it. That said, there would be no hurt feelings if someone else wanted to tackle this before then. I would appreciate any assistance in this matter. -- Heaven's Agent 18:28, 27 December 2011 (UTC)
- I think I have it figured out. I tried it out on the Template:NPCInfoBox and here is the result: We can always tweak it more. What are you wanting to adjust on the item tooltip? -- 21:58, 27 December 2011 (UTC)
- Basically to scale it down somewhat so that extra spaces are omitted, font is decreased, format more closely resembles the in-game tooltips; basically make it smaller so that the tooltip doesn't dominate an article when it is generated. An example of what I'm envisioning is in my Sandbox as well.
- As a quick aside on the NPC Infobox changes you made to get that tooltip functional: you ended up breaking every instance of that infobox already in use on this project that includes an image. There's over 100 articles that we'll need to revisit, but more importantly you hard-coded the image description to match the article name; I've been trying to ensure the description matches the name of the NPC as it appears in the game, which sometimes includes a rank whereas our article titles do not. -- Heaven's Agent 22:06, 27 December 2011 (UTC)
- After looking at your implementation, maybe my issue is that I attempted to define the tooltip as an infobox. I'll try something a little more similar to your code the next time I give it a go. -- Heaven's Agent 22:12, 27 December 2011 (UTC)
- I adjusted the infobox to use the NPC name for the image description. I'm going through and fixing each of the articles so the image links correctly. The reason I made the change is we can resize the image as needed for the tooltip, it adds uniformity across articles and leaves less hand coding for contributors. -- 22:19, 27 December 2011 (UTC)
- I figured that was the likely reason, though I dislike the method because it creates two different formats for adding images to articles on the project. It tends to confuse new contributors. -- Heaven's Agent 22:29, 27 December 2011 (UTC)
Line spacing in item tooltip[edit source]
Alright, I've got formatted item tooltips working thanks in large part to using Alianin's implementation as a foundation (example: ). For some reason, though, the spacing between each line is greater than what I was going for, as depicted to the right. Any ideas as to what might be causing this? -- Heaven's Agent 23:22, 27 December 2011 (UTC)
- if you can add line-height:1.3em to the <div class="infobox tooltip-content" style, the rendering should be more compact Skilf 18:54, 2 January 2012 (UTC)
- Thanks for the tip, Skilf. Though still not exactly what I'm aiming for, it is a lot closer and gives me something else to work with in the future. -- Heaven's Agent 19:44, 2 January 2012 (UTC)
Icon-based tooltips[edit source]
Is there any way to generate an item tooltip when someone hovers their mouse cursor over an item's icon? I'm trying to come up with ways to streamline schematic tables for the crafting skills, and such functionality might be one way to accomplish this. -- Heaven's Agent 04:01, 28 December 2011 (UTC)