Template talk:Tooltip

From Lotro-Wiki.com
Jump to navigation Jump to search

Conversion

All links to the old tooltip have been changed to {{Item Tooltip}}. Tooltip has now been replaced with New from the test-wiki. Amphoras (talkTalk to me!) 05:47, 6 October 2011 (EDT)

Different modes

Currently we have imlink and link. I then added the mode icon, but to be consistent it should be called im. As

  • imlink = icon + text
  • link = text
  • im = icon ?

What would you think of allowing both iconlink and imlink? And both im and icon for icons only? I'm also into changing all imlink occurrences with iconlink, but I want it to be consistent :) --EoD (talk) 09:18, 19 October 2011 (EDT)

Suggestion for Extra Info Field

While looking at the Effect's template and using "mode=imlink" I found no way to get across some extra info, such as from the "attrib" parameter. Did I miss something? Or is that not possible? Yet?

If "not" I suggest a new parameter, tentatively called "trailing-text", which follows as-is after the linkified name.

Examples of today versus wanted, using an Effect (but it could apply on many other templates I guess):

{{:Weakened Armour|mode=imlink}} -->  Weakened Armour
{{:Weakened Armour|mode=imlink}} -->  Weakened Armour  Reduced armour protection

Notice that "attrib" of Weakened Armour reads "-X Armour Value" but I agree with Elin who suggested that the "-X" gives weird or mixed feelings, and in some cases the text in attrib is awkward or could be reduced a lot still retaining the crucial info. Using a new parameter gives us the choice of displaying a more useful text, when needed. (Neither is the "description" parameter in the Effect template useful in the common case, too often it is more of lore than anything informative.)

So, in the Effect template we would have something like

trailing-text = ''{{#if:{{{attrib-display|}}}|{{{attrib-display}}}|{{{attrib}}}}}''

I have not thought of other use cases than Effect, but I would not be surprised if there are many. On the other hand, "mode=imlink" is perhaps not the best choice since that mode may be used in common bread text as well, and perhaps the extra does not go well with that. Hence maybe a new but very similar mode would do better, such as "mode=imlink+". You are the experts, I am just the troublemaker, so go bash at me now :)
-- Zimoon 12:09, 30 September 2012 (EDT)

I am back to the Effect template and have two requests:
  • Make "imlink" take a new parameter for "extra info" and treat the "info" as-is.
  • Make "imlink" support variable icon-size, currently all icons are transcluded as 32px.
Extra info - The reason is that several templates are emitting imlink:s onto different kind of pages and it is desirable that the "extra info" is displayed automagically, otherwise the editors must manually add some info at each page after the template part and we ware just humans. Either we forget, lack the time and then forget, add variations of text (which not seldom has been less informative or lore at best), etc. Example: imlink can be used for the Effect template, the Effect also comes with an effect, but what does it do? That is where the "extra info" comes to play. And I can imagine that several other templates could use the same feature, or simply ignore this new parameter. Tentative addition:
|imlink={{#if:{{{icon|}}}
       |{{Icon|{{{icon}}}|link={{{disambigpage|{{{name}}}}}}
       |{{#if:{{{amount|}}}|{{#ifexpr:{{{amount|1}}} > 1|{{{amount}}}}}}}}}
       }} [[{{{disambigpage}}}|<span class="ajaxttlink">{{{name}}}</span>]]<!--
 new-->{{#if:{{{extra_info|}}}|{{{extra_info}}}}}
Icon-size - Again the reason is that at some pages it is desirable to have another icon-size than 32px from imlink. Notice the anomaly that this template indeed supports other icon sizes, but not for imlink. I suggest something like this (untested), using "size" from the Icon template (values 1,2,3,4):
|imlink={{#if:{{{icon|}}}
       |{{Icon|{{{icon}}}|link={{{disambigpage|{{{name}}}}}}
       |{{#if:{{{amount|}}}|{{#ifexpr:{{{amount|1}}} > 1|{{{amount}}}}}}}}}
 new > |{{#if:{{{size|}}}|size={{{size|}}}}}
       }} [[{{{disambigpage}}}|<span class="ajaxttlink">{{{name}}}</span>]]
I guess changing this template will cause a massive batch job so this is not something I want to do lightly, please, please, review and suggest whatever before we move forward.
-- Zimoon 04:28, 1 November 2012 (EDT)
I have tested adding the size-suggestion to the Effect and the Tooltip templates at test-wiki. That worked fine. Eventually. {{:Effectaname|mode=imlink}} will render the icon in 24x24px using the size parameter of the Icon-template. I have not yet tested the suggestion about extra_info but will play with that within a few days -- need to play Lotro too ;) I will also review any other suggestion at this template to apply all at once to minimize the extreme workload any edit of this template will cause. -- Zimoon 14:13, 8 November 2012 (EST)
Now also a new "trailing_info" is added to the Effects template at the test-Wiki, as well as a "trailing" is added to the Tooltip template there. I would say that works well. This means that any template utilizing Tooltip could use "trailing" for information right after the icon-and-link. In the Effects case that template applies italics to the text before handing it off to Tooltip, but a utilizing template may do whatever in this respect. Furthermore, the parameter is only implemented for "imlink", though could of course be used for anything. -- Zimoon 14:19, 9 November 2012 (EST)
Where is that test-wiki? I need to take note of it somewhere! :) -- Goingbald (talk) 02:30, 10 November 2012 (EST)
Get into IRC one day and you will get the link. I am not sure we want to put it up publicly, that is for Lotroadmin to decide I guess. -- Zimoon 04:24, 10 November 2012 (EST)
Regarding support for trailing texts for Effect pages, this is added just minutes ago. That change may be used by any template utilizing this template, currently only for "mode=imlink" though. See this diff for one way to use this new feature.
-- Zimoon 04:26, 14 December 2012 (EST)

Trailing space in display

Consider the following code:

'''Requires {{:Enemy Defeat Response|mode=imlink}}).''' -- displays as:
Requires  Enemy Defeat Response).

However,

'''Requires {{:Enemy Defeat Response|mode=link}}).''' -- displays as:
Requires Enemy Defeat Response).


Note the trailing space inserted by the template ahead of the right-paren when using imlink.

Wm Magill - Valamar - OTG/OTC - talk 14:19, 10 July 2013 (EDT)
My hunch is that this is coming from the &nbsp ; in the imlink mode section of the template. It looks like Zimoon added this intentionally in December last year. I don't think it really causes problems, unless you try to add puntuation immediately afterwards like in that example, which looks pretty bizarre. It's difficult to test since this is such an upstream template - I might need to try this out on the test wiki. If I can even find the site for that again, it's been quite a while since I've gone there. -- Elinnea (talk) 19:59, 10 July 2013 (EDT)
Once again I typed too soon! I guess I had it bookmarked way back when in Firefox, which imported into Chrome on another computer, so I automatically see it on this new computer as well. Ain't technology swell? I'll take a look at the imlink mode over there. -- Elinnea (talk) 20:02, 10 July 2013 (EDT)
I've added another "if" for imlink, that space seems only useful if there is that trailing-text, so no need to have it everywhere, but there is still different behaviors with the templates when writing this comment:
-- Goingbald (talk) 02:46, 17 July 2013 (EDT)

Staying on the same page... Skill/Effect/Trait [[ ]] vs |mode=imlink}}

Sigh, easier said than done... So, correct me if I'm wrong...

We now have 3 "new" templates(chages) -- Template: Skill Template: Effect Template: Trait

Each use (including Boilerplate and Preloads) should be configured:
__NOTOC__<onlyinclude>{{Skill
 | mode={{{mode|}}}
 | arg={{{arg|}}}
 | name                = 
 | disambigpage        = {{subst:FULLPAGENAME}}
 | icon                = -icon

And all references to a Skill/Effect/Trait should be of the form: {{:Master (skill)|Master|mode=imlink}} instead of [[Master]]

 Master or Master instead of Master
  • So this begs the question -- (and here I'm way beyond my knowledge base) can/should we ?configure?change?(whatever term) the functionality of [[ ]] to default to imlink?
The two issues I see are first, purely technical -- how big a change effort this would be; and second what are the philosophical implications. I.e. other than the fact of needing to document the change, it would make Lotro-wiki editing "different" from editing other Wikis.
Again feel free to chime in here, I'm way beyond my ken. I suppose that this kind of change has to be ok'd/implemented by Lotroadmin, as it would likely be a patch to something as opposed to a simple template change... I don't know.
  • Obviously the benefit of changing the default behavior would be to dramatically reduce the editing needed for the change over... but it would likely screw-up a lot of table formatting... but going forward, the benefit would be pretty strong. (I'm guessing.)
Please chime in... Wm Magill - Valamar - OTG/OTC - talk 01:52, 11 July 2013 (EDT)

Bug or just an interaction quirk?

Just trying to update the Ettemoors entry for the South-Bree stable-master Bert Goldenleaf with the text from the MP page:

VIP players: Greyed out until level 20 -OR-
Free and Premium players can purchase a temporary Ettenmoors pass for 20 of the 20 Mithril Coin currency to purchase 6 hours of PVMP playtime.
  • Note how this works on this page. The "20" is layered on top of the MC icon. However, on Bert's page, the 20 is out in the "next column" on the table. (below)

Clearly, this is an "interaction problem." I don't know that it is particularly worth spending a lot of time to track down, but if it's a quick and easy fix....

Destination Region Cost Prerequisites
The Ettenmoors
Ettenmoors (Swift) Ettenmoors 1 Silver  VIP players: Greyed out until level 20 -OR-
Free and Premium players can purchase a temporary Ettenmoors pass for 20 of the 20 Mithril Coin currency to purchase 6 hours of PVMP playtime.

I suspect it has to do with multiple columns -- removing either "sortable altRowsMed" does not change the effect, nor does removing the entire class statement.

Wm Magill - Valamar - OTG/OTC - talk 05:53, 22 June 2014 (UTC)

Can we have an "mode=iconlink" parameter

We currently have "mode=imlink" which displays the name and the Icon, and when you mouse-over the name, causes the tool-tip to pop-up. Example:  Mark of Grimbeorn

  • Is it possible to create a "mode=iconlink" which like "mode=icon" displays only the Icon (Example: ), but like the imlink causes the tool-tip to pop-up when moused over?

In particular, I am looking to use this in the body of the Trait Tree pages -- Beorning Trait Tree for example.

Wm Magill - Valamar - OTG/OTC - talk 01:32, 11 December 2014 (UTC)
  • I just noticed -- This appears to be a bug with the Template:Skill ... note how the icon in the previous example: 20 Mithril Coin, you get a tooltip when you mouse over the Icon, but not with the Skill. and mode=icon does what I am looking for: 20
Wm Magill - Valamar - OTG/OTC - talk 01:41, 11 December 2014 (UTC)
  • Ok, not a bug, an implementation defficiency. From the front page here:
Note: amount will only work for pages that properly pass amount parameters down to this template (i.e. only items at this point). Also, because icons created this way act as a link to the target page, item icons will generate an on-hover pop-up while effect icons will not (see note above).
I'm not at all certain what that note means, it doesn't make sense to me. Hopefully one of you who understands templates will elaborate on it.
Wm Magill - Valamar - OTG/OTC - talk 01:46, 11 December 2014 (UTC)

With my limited understanding of templates: It appears that the difference between Template: Item Tooltip, Template: Effect and Template: Skill is that Item Tooltip begins:

{{Tooltip
| mode         = {{#ifeq: {{{mode|}}} | imlink_plain | imlink | {{{mode|}}} }}
| amount       = {{{amount|}}}
| name         = {{#ifeq: {{{mode|}}} | imlink_plain | {{#if:{{{arg|{{{rename|}}}}}}|{{{arg|{{{rename|}}}}}}|{{{name}}}}} | {{quality| {{{quality|}}} | {{#if:{{{arg|{{{rename|}}}}}}|{{{arg|{{{rename|}}}}}}|{{{name}}}}} }} }}
| disambigpage = {{{disambigpage}}}
| icon         = {{{icon|}}}
| alltherest   = <ul>

Is that all that needs to be added to those two templates to "properly pass amount parameters down to this template"?

Wm Magill - Valamar - OTG/OTC - talk 02:02, 11 December 2014 (UTC)
Any particular reason you need to account for an "amount" of a skill? The amount = {{{amount|}}} line in the code above is what does the trick, though. Sethladan 03:44, 11 December 2014 (UTC)
And, yeah, I'd say that's either a bug or an implementation oversight (regarding mode=icon); it should be generating a tooltip when you hover over the icon that's output. Classes just finished today, so I'll look into this when I get through exams next week. Thanks for bringing it up! Sethladan 03:49, 11 December 2014 (UTC)
No, the Amount was simply what was being described on the other page.
Currently, at least on the Trait Tree pages -- Beorning Trait Tree -- (I haven't really checked the other classes, but they are all "copies") what one gets is a pop-up which simply displays the name, not the same pop-up you get from the "name link" - Example:  Mark of Grimbeorn; mousing over the icon portion only generates a pop-up with the name of the skill. Mousing over the name gives you the actual tool-tip unlike mousing over the icon in:
An Item page can pop its tooltip when checking the "Recent changes" page, where for sure nothing has been done on how to display the link... Having the mode=icon allows then to display it too without problem... Something must be done by default for any Item page, guessing it's where this ajaxttlink is defined, but I don't know/recall where to find it, is it a java (.js) or css file? If there is a default behavior if the page starts by "Item:", maybe we should rename pages to also have prefixes like "Trait:", "Skill:" & "Effect:", that would also benefit of having a tooltip displayed by default, then add these in the java or css file? "Relic:" already exists, could also get a tooltip by default. -- Goingbald (talk) 18:44, 13 December 2014 (UTC)


If you really want to look into enabling tooltips for all links, the code to do it for Item links is at the end of MediaWiki:Lord of the tooltips.js, just above the $function() declaration. Lotroadmin has been against having lots of namespaces (for skills, effects, etc) in the past, but I can think of one or two ways we might be able to make this work. Sethladan 18:54, 14 December 2014 (UTC)

At the risk of opening old wounds :) --- On MediaWiki:Lord of the tooltips.js is a reference to: "See Help:Tooltips" - which does not exist.
  1. Is the content on Template: Tooltip that would have been in that page?
  2. Any idea what that page SHOULD contain?
  3. If yes, can we change the "see" to point directly to Template: Tooltip
  4. If yes or otherwise can we simply delete that reference. I always spend some amount of time rounding up "the usual suspects" - always to no avail.
"Documentation - We don't need no stink'n Documentation mon!"
Wm Magill - Valamar - OTG/OTC - talk 01:48, 15 December 2014 (UTC)
Definitely either axe the reference or point it to an actual existing page (whichever you think is more helpful). It was probably a holdover from WoWwiki (from which the code was primarily copied) - I might actually go look at https://www.wowwiki.com/Help:Tooltips some day to get ideas for more magic tricks. :) Sethladan 02:02, 15 December 2014 (UTC)
Hmmm, I don't know what to do... Do we want to try to have more "spacenames" or not? -- Goingbald (talk) 02:21, 17 December 2014 (UTC)
I realize I'm just displaying my own ignorance here, but -- What is the issue with Namespace? Is there a problem with making the "tool-tip pop-up" happen everywhere? Is it just an overhead issue? But that can't be -- because the "tool-tip pop-up" happens when you mouse-over the name (no matter what the namespace), just not when you mouse-over the icon. I'm really confused.
Wm Magill - Valamar - OTG/OTC - talk 16:01, 18 December 2014 (UTC)

Proposed changes (Relics)

Let's bring relics into the modern age. I've got some changes that'll

  • Allow pages using the {{Relic}} template to be transcluded as a tooltip, and
  • Transclude relics directly into {{Item Tooltip}} pulling icon and attribute information from the relic page.

Changes to three templates will be necessary for this to happen (edit the user pages to see the modified code):

All relic pages and sealed relic item pages will be affected, but these changes can easily be made with the replace extension:

  • Relic pages
    • Add <onlyinclude> tags
    • Add "smallicon" parameter (for full-size vs. "embedded" icons)
      • We have not been including the embedded icons previously, so for now, the default "big" icon will be used in both places as we have been.
  • Sealed relic item pages -- Replace the three relic parameters with "relic"

And finally, all occurrences of links to relics outside the item tooltip template should be updated to the format {{:Relic:name|mode=imlink}}

Two examples of these changes can be seen here:

Feedback is welcome and encouraged. If nothing, I'll make these changes in a few days. Neum (talk) 15:47, 7 July 2018 (UTC)

new mode parameter - disabled

Would like to propose a change to the template that would allow new mode parameter - disabled.
This mode would be intended for use one pages that have several tooltips on them, but are desired to show only one when linked from other pages.
I have implemented this in my sandbox - skill page with multiple tooltip sections User:Drono/TooltipUpshot and the template used and example of linking - User:Drono/TooltipSandbox
Feedback welcome. --Drono (talk) 08:57, 24 February 2021 (UTC)
Note:change was implemented and i have deleted these sandbox pages. Will use Template:<name>/sandbox in future --Drono (talk) 09:14, 9 June 2021 (UTC)

I like this idea and it should be a pretty easy change to boot. --Gaerlin (talk) 22:06, 24 February 2021 (UTC)
  • So there are no test cases that show current template output vs the new functionality? I'm not sure exactly what "disabled" is supposed to do. Sagarmatha (talk) 06:25, 1 March 2021 (UTC)
The test case is my sandbox pages vs the live pages. I have edited the example in my TooltipSandbox to show also the current state. --Drono (talk) 07:31, 1 March 2021 (UTC)
  • Okay thanks. Perhaps this would be a good time for creating a separate test cases page for future regression testing of template changes? Sagarmatha (talk) 20:15, 3 March 2021 (UTC)
Not sure what you mean by 'test case page', every user can create pages under their username as i did, which can be used as sandbox/test pages - after applying the change, it will be seen in history of this page, and i plan to remove the test pages as they are not useful anymore - their purpose is to show how it will look after the change so you dont need to edit the template yourself and use the preview button to see them.(Edit: realized in this case it would not show the change, but in most cases it would.)
I know that before i joined the wiki there was also test wiki, some talkpages refer to it but seems it was discontinued, i guess the editors didnt find it useful. --Drono (talk) 09:14, 4 March 2021 (UTC)