Archive 1

Order of paramenters

Hello!, it's good to see that there is one template to handle abbreviations. I'm working on the Wikipedia:Accessibility project, and I was disappointed when I discovered that MediaWiki doesn't support the <abbr> tag, but this should be changed for web accessibility reasons. I'll ask developers to support that tag (but not <acronym>, it will be deprecated on XHTML 2.0), but editors can start using that facility thanks to this template.

However, I think that the order of parameters should be reversed. At the time of writing, the first parameter is the explanation, while the second one is the abbreviated form:

<span … title="{{{1}}}">{{{2}}}</span>

This is analogous to the <abbr> tag:

<abbr title="abbreviation">abbr.</abbr>

However, the expanded form is not required after the first appearance, so this should be optional. Therefore, I think the abbreviated form should be the first paramenter, and the expanded form should be the second one and optional:

<span … {{#if:{{{2|}}} | title="{{{2}}}" }} >{{{1}}}</span>

Currently there are few pages using this template, so the impact of the change will be easy to repair. What do you think? --surueña 21:53, 8 May 2006 (UTC)

Strange formatting

This template produced pretty strange formatting in the infobox of United Kingdom:

In the <p><span class="abbr" style="border-bottom: 1px dotted" title="United Kingdom">UK</span>, <a href="/wiki/Languages_in_the_United_Kingdom" title="Languages in the United Kingdom">some other languages</a> have been officially recognised as legitimate <a href="/wiki/Autochthonous_language" title="Autochthonous language">autochthonous</a> <a href="/wiki/Regional_language" title="Regional language">(regional) languages</a> under the <a href="/wiki/European_Charter_for_Regional_or_Minority_Languages" title="European Charter for Regional or Minority Languages">European Charter for Regional or Minority Languages</a>. In each of these, the</p> <span class="abbr">UK</span>

Notice the <p> and </p> tags which create new lines where not needed.--Pethr 18:15, 25 May 2007 (UTC)

unicode

Added a parameter for Unicode formatting. Tried for IPA as well, but the IPA template popup overrides the one from this template. Will simply copy the IPA template code over if I don't find a simpler workaround. kwami (talk) 20:18, 25 April 2010 (UTC)

Usefulness with wikified terms

I think some consideration along the following lines should be included in the template's documentation (rewritten as a style guideline instead of my speculation):

This template does work with a wikified term; hovering over the underline (actually border-bottom, it seems) will show the intended tooltip (at least in Firefox). But the text of the link itself will have its own tooltip with the name of the article to which it links, and is more likely to be hovered over than a dotted line under it. Wikified terms should be written as unredirecting links, and in many cases the tooltips for those links would already have the explanatory text in it, but not always.

So which of the following ways would be best to explain WYSIWYG, an article that uses the acronym as its title, to someone who doesn't click the link, but might hover over it?

  • WYSIWYG - with the template and two tooltips, the more useful of which is less likely to be hovered over
  • WYSYWIG - linking to a redirecting article shown as the tooltip, which explains the acronym
  • WYSIWYG (What You See Is What You Get) - with the explanation written in the text (useful for non-linking versions of the article's text, such as a paper reprint)

B7T (talk) 03:30, 31 August 2010 (UTC)

FYI

{{Tooltip}} no longer redirects to this page; it was recreated here, but it was just protected a few hours ago, so I can't undo that edit. --64.85.216.174 (talk) 14:34, 18 June 2011 (UTC)

I've reverted it back to a redirect. -- WOSlinker (talk) 16:21, 18 June 2011 (UTC)

New template requested — Discreet abbreviation

Hello,

See this discussion.

--Nnemo (talk) 23:23, 24 September 2011 (UTC)

Availability in other languages

The title seems self-explanatory. Is this wonderful template available in other languages? I'd like it to be available in Dutch but am not able to do so. Markvanw (talk) 08:26, 5 November 2011 (UTC)

On the main template page, there are eight languages listed in the left-hand margin. From top to bottom, these are: Belarusian; Esperanto; French; Indonesian; Japanese; Oriya; Persian; Russian. --Redrose64 (talk) 13:03, 6 November 2011 (UTC)

New class parameter

I've updated the sandbox to add an optional fourth parameter, which will add an HTML class attribute. This can be used for adding microformat attributes, or, later, for styling. Please will someone check my code? Andy Mabbett (Pigsonthewing); Talk to Andy; Andy's edits 23:37, 19 August 2012 (UTC)

It will fail if no 3rd parameter is given (which is also optional). Such parameters should be named. Edokter (talk) — 08:32, 20 August 2012 (UTC)
I envisioned that it would be used as, say, {{Abbr|Hz|hertz||ClassName}}, but thanks for your changes. I've made an edit request. Once that's done, we'll need to update {{Abbrlink}} accordingly. Andy Mabbett (Pigsonthewing); Talk to Andy; Andy's edits 10:48, 20 August 2012 (UTC)
  Done after some puzzling why my tests didn't work, I found that the examples on the doc page were badly-formatted. --Redrose64 (talk) 12:25, 20 August 2012 (UTC)
Thank you; I've updated the documentation. The classes do not appear in the rendered HTML. Have I messed up; is there a bug; a caching issue; or is MediaWiki stripping the attributes? Andy Mabbett (Pigsonthewing); Talk to Andy; Andy's edits 13:18, 20 August 2012 (UTC)
The quotes were prematurely closing the HTML attributes; never use quotes in template parameters. Edokter (talk) — 14:53, 20 August 2012 (UTC)
(edit conflict) What Edokter said. By using quotes in both the template code and its invocation, you were creating invalid HTML: {{abbr|UK|United Kingdom|class="country-name"|id="foobar"}}<abbr class=""country-name"" id=""foobar"" title="<nowiki>United Kingdom</nowiki>">UK</abbr> and the MediaWiki parser was cleaning this up to give <abbr title="United Kingdom">UK</abbr>. I've removed those quotes from the doc page, so we now have {{abbr|UK|United Kingdom|class=country-name|id=foobar}}<abbr class="country-name" id="foobar" title="<nowiki>United Kingdom</nowiki>">UK</abbr><abbr class="country-name" id="foobar" title="United Kingdom">UK</abbr>. --Redrose64 (talk) 15:20, 20 August 2012 (UTC)
Of course, thank you, both. So, how do we pass the parameters from {{Abbrlink}}? Andy Mabbett (Pigsonthewing); Talk to Andy; Andy's edits 17:02, 20 August 2012 (UTC)
Simply pass them. It's been taken care of. Edokter (talk) — 18:23, 20 August 2012 (UTC)
Thank you again. Andy Mabbett (Pigsonthewing); Talk to Andy; Andy's edits 18:27, 20 August 2012 (UTC)

A complicated usage, which doesn't work

I'm trying to build a an abbreviation whose long text is transcluded:

{{abbr|'''BIT'''|{{User:Johnmperry/sandbox/runway|transcludesection=surface-BIT}}}} which does this - BIT

That works OK, but the problem is the transcluded code includes a wikilink - square brackets are included in the pop-up text, but thankfully no actual link. So I want to get rid of them. Am I going wrong here? - I wrap the transclusion part in <code>...</code>? Thus: {{abbr|'''BIT'''|<code>{{User:Johnmperry/sandbox/runway|transcludesection=surface-BIT}}</code>}}

But it doesn't work, ;

BIT

is the code tag the correct one to use? It's always worked for me before.

(I got the same behaviour when I tried using the html <abbr> tag directly.)

By the way, on older items in this talk page, the popup contains just text. Now it carries a big fat black question mark above it.

John of Cromer in China (talk) mytime= Wed 23:55, wikitime= 15:55, 21 November 2012 (UTC)

The <code>...</code> element is used to represent a fragment of computer code. It does nothing apart from change the appearance of text, normally to a monospace font like this. Popup text or "tooltips" cannot contain Wiki markup, since they are placed inside the title= attribute of <abbr> tag: note that it explicitly states "The attribute, if specified, must contain an expansion of the abbreviation, and nothing else." More generally, HTML attributes can never contain markup. --Redrose64 (talk) 16:30, 21 November 2012 (UTC)

"#" interpreted as Wikicode

I tried to use {{Abbr|#|Number}} as per WP:POUND, but the pound appears to be processed as Wikicode.

"Supperman first appeared in ''Dinner Comix'' {{Abbr|#|Number}}}}1 in 1938." renders as:

Supperman first appeared in Dinner Comix #1 in 1938.

Is something like {{#tag:nowiki}} needed? CüRlyTüRkeyTalkContribs 12:44, 26 November 2012 (UTC)

That is normal behaviour for the MediaWiki template parser: when the value returned by many parser functions begins with colon, semicolon, hash or asterisk, it's treated as if it were the start of a new line; a hash initiates an ordered list, these are normally numbered. There are at least two workarounds:
  • {{Abbr|&#x23;|Number}}#
  • {{Abbr|<nowiki />#|Number}}#
--Redrose64 (talk) 13:31, 26 November 2012 (UTC)
While it may be "normal behaviour for the MediaWiki template parser", is there a use case for this type of behaviour with this particular template? If not, it's certainly not what most of us would expect. It seems to be causing frustration with others than myself, as well: usage of the template (with this hack) was removed by User:Dicklyon with the edit comment "that abbr. hack is getting ridiculous, and still doesn't work; just use number sign".
Wouldn't fixing it so useless, unexpected behaviour doesn't happen be better? CüRlyTüRkeyTalkContribs 01:20, 27 November 2012 (UTC)
I'm kind of surprised that there is no HTML entity name for this. "Pound" is something else to this Brit (£). So whatever you do, don't use &pound;.
A propos WP:POUND, I try to avoid making any abbreviation the same as a real word, so rather than No. I would use Nr (which also happens to be normal German form). I suppose you could use N<sup>o</sup> (= No) or N&ordm; (= Nº)
John of Cromer in China (talk) mytime= Tue 10:45, wikitime= 02:45, 27 November 2012 (UTC)
Well, except that No and Nº are both non-standard. The standard for American comic books is #. I'm trying to use this standard in the most helpful way with the least amount of hackery. CüRlyTüRkeyTalkContribs 13:34, 27 November 2012 (UTC)
There is no HTML entity name for # because none is needed. HTML entity names were created as a means of displaying characters belonging to two groups: (i) four characters (& > < ") which have a special meaning in HTML syntax, for which &amp; &gt; &lt; &quot; were defined; (ii) those not provided on a standard American keyboard, the best-known of these is &nbsp; but &pound; is also one of them. The hash mark is provided. However, any character (typeable or not) may be specified using the numeric entity syntax, as I demonstrated above: &#x23;# (and &#35;#).
Regarding "Nr": please don't use German conventions - this is the English Wikipedia, and we are writing for readers of the English language. The Manual of Style is clear: subject to one specific exception, the only permitted abbreviation for "number" is "No." (two letters and one period, no other characters). The one exception is for comic book issue numbers, where the hash mark is permitted. --Redrose64 (talk) 13:11, 27 November 2012 (UTC)
The main problem on "English Wikipedia" is those pages with untypeable names, so you can't actually get there directly. The edit bar isn't going to help. The other day I came across a page called Pāṇini. That's impossible to type on a keyboard outside wherever (Pakistan I think). Of course you could escape it ... http://en.wikipedia.org/wiki/P%C4%81%E1%B9%87ini ... Even "normal" accented characters are difficult to type into the address bar, such as Béguinage.
Anyway, to the problem in hand. What is needed is something before the # (hash, or as WP:MOS has it, pound) which takes up no space on the rendered page, but makes # no longer the leading character. There are two characters to choose from:
  1. zero width non-joiner &zwnj;
  2. zero width joiner &zwj;
I'm not sure what the term non-joiner means. I don't think it matters here. So you should decide -
  1. "Supperman first appeared in ''Dinner Comix'' {{Abbr|&zwnj;#|Number}}}}1 in 1938." renders as:
    Supperman first appeared in Dinner Comix ‌#1 in 1938.
    and
  2. "Supperman first appeared in ''Dinner Comix'' {{Abbr|&zwj;#|Number}}}}1 in 1938." renders as:
    Supperman first appeared in Dinner Comix ‍#1 in 1938.
(PS I think you mean Superman) John of Cromer in China (talk) mytime= Wed 08:31, wikitime= 00:31, 28 November 2012 (UTC)
(I'll bet you a pound I don't!) CüRlyTüRkeyTalkContribs 03:33, 28 November 2012 (UTC)
Stuff like Béguinage shouldn't be a problem. The editors should be creating redirects to hand that—try clicking Beguinage and watch the magic in action.
I actually created a template, {{No.}}, to handle the pund/hash/number sign for comic book articles until {{Abbr}} can be made to handle it. I don't think it's reasonable to expect most editors to know what an HTML entity is, and I don't think it's reasonable to expect such bizarre output as what {{Abbr|#|Number}} currently produces. The fewer ugly hacks on the page the better. CüRlyTüRkeyTalkContribs 03:40, 28 November 2012 (UTC)
Regarding Pāṇini: Wikipedia:Article titles#Special characters says to create redirects so that the title may be entered easily when using keyboards that do not have these characters. Panini is a disambiguation page, not a redirect; but one of the entries in that does link directly to Pāṇini. As noted above, Beguinage is a redirect to Béguinage.
You ask for "something before the # ... which takes up no space on the rendered page, but makes # no longer the leading character"; I have already demonstrated one method of doing exactly this: it is <nowiki />:
  • {{Abbr|<nowiki />#|Number}}#
It doesn't have to be <nowiki /> - some HTML elements (those which have no effect when there are neither attributes nor content) will do instead, for example <span></span>:
  • {{Abbr|<span></span>#|Number}}#
Both of these are in use with other templates, and the <nowiki /> method is certainly documented, so there is no real reason not to do it this way. By contrast, the use of the zero-width joiner and zero-width non-joiner characters is not encouraged; there has been discussion about these on other pages like WP:VPT. They have their uses, but template hacks are not among them.
The template {{No.}} does work; when it's been through MediaWiki template expansion, it is identical to {{Abbr|&#x23;|Number}} in its effect. I have no objection to its use; but as Curly Turkey is aware, it doesn't support some of the other features of {{abbr}}, the |class= and |id= parameters (the third, unnamed, parameter is unnecessary since neither "No." nor "Number" require the use of Unicode or IPA treatment). --Redrose64 (talk) 08:09, 28 November 2012 (UTC)

Use with images

Per discussion at Template talk:Infobox user#Wikipedian instead of Wikipedian Unknown by default and recent edits to {{Infobox user}}, can we make this template accept images? Andy Mabbett (Pigsonthewing); Talk to Andy; Andy's edits 14:32, 5 September 2013 (UTC)

It seems to take images just fine as is.   Edokter (talk) — 15:33, 5 September 2013 (UTC)

Use in CS1 templates

When used in a Citation Style 1 template, the strip markers are exposed:

Markup Renders as
{{cite book |title=Title |date={{abbr|c.|circa}} 1900}}

Title. c. 1900. {{cite book}}: Check date values in: |date= (help); Unknown parameter |template doc demo= ignored (|no-tracking= suggested) (help)

'"`UNIQ--templatestyles-00000032-QINU`"'<cite class="citation book cs1">''Title''. <abbr title="circa">c.</abbr> 1900.</cite><span title="ctx_ver=Z39.88-2004&rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&rft.genre=book&rft.btitle=Title&rfr_id=info%3Asid%2Fen.wikipedia.org%3ATemplate+talk%3AAbbr%2FArchive+1" class="Z3988"></span> <span class="cs1-visible-error citation-comment"><code class="cs1-code">{{[[Template:cite book|cite book]]}}</code>: </span><span class="cs1-visible-error citation-comment">Check date values in: <code class="cs1-code">&#124;date=</code> ([[Help:CS1 errors#bad_date|help]])</span>

--  Gadget850 talk 09:56, 17 April 2014 (UTC)

It is because of the #tag:nowiki used in the template. --  Gadget850 talk 10:04, 17 April 2014 (UTC)
The #tag seems to have more of these issues, see also Template talk:Reflist#Capitalized <ref> causes extra backlink.

Styling

Would it be possible to add a switch, say |underline=no, to style the abbr without underlining? Andy Mabbett (Pigsonthewing); Talk to Andy; Andy's edits 19:20, 13 August 2013 (UTC)

Possible, yes. But doing so introduces an inconsistency in how <abbr> is styled. Why would you want to disable it? Edokter (talk) — 21:15, 13 August 2013 (UTC)
In tables, where an abbreviation is repeated many times, underlining each would be excessive. And it overwhelms short abbreviations such as . Andy Mabbett (Pigsonthewing); Talk to Andy; Andy's edits 21:22, 13 August 2013 (UTC)
My perhaps obvious answer would be: don't repeat it then (asuming they're the same). With the underline removed, there would be no indication of an available tooltip, which hurts accessability, so I am hesitant to add such an option. Edokter (talk) — 22:16, 13 August 2013 (UTC)
[Belated response, sorry] repetition is necessary in sortable tables. Andy Mabbett (Pigsonthewing); Talk to Andy; Andy's edits 19:23, 11 June 2014 (UTC)

Requested move 11 June 2014

The following discussion is an archived discussion of a requested move. Please do not modify it. Subsequent comments should be made in a new section on the talk page. Editors desiring to contest the closing decision should consider a move review. No further edits should be made to this section.

The result of the move request was: Withdrawn by requester. (non-admin closure) Sardanaphalus (talk) 08:46, 12 June 2014 (UTC)


Template:AbbrTemplate:Tooltip – Adding a tooltip seems to be this template's purpose and what makes it distinctive. Sardanaphalus (talk) 09:14, 11 June 2014 (UTC)

Survey

Feel free to state your position on the renaming proposal by beginning a new line in this section with *'''Support''' or *'''Oppose''', then sign your comment with ~~~~. Since polling is not a substitute for discussion, please explain your reasons, taking into account Wikipedia's policy on article titles.

Discussion

Any additional comments:

The above discussion is preserved as an archive of a requested move. Please do not modify it. Subsequent comments should be made in a new section on this talk page or in a move review. No further edits should be made to this section.

OK to combine abbr and wikilink?

Demo 2
The alphabet (+anchor target)ABCDEFXYZ
Other info26 letters
Also calledABC

I have a space-restricted table, no place to spell things out. In there, I can combine {{abbr}} and wikilink [[#To anchor]]:

Demo 1

{{anchor|ToUSanchor}} is here, invisible: ><
Elsewhere: [[#ToUSanchor|{{abbr|U.S.|United States}}]]
U.S.

With me, the anchor/link shows the two underlines asked for (OK). Both abbr expanding and clicking work as expected. Note that the anchor-target is on the same page (linking to outside is not asked for).

My question is: is this, by W3C page design principles, a correct way to use <abbr>?

Note: interestingly, this also functions, twice, in mobile view.
Note: the inverse nesting does not work well

Demo 3: {{abbr|U.K.|[[#ToUKanchor|United Kingdom]]}}ABC  N

(Repeated here to check scroll effect: U.S.). -DePiep (talk) 14:20, 4 November 2014 (UTC)

Demo 1 works because the emitted HTML is valid:
<a href="#ToUSanchor"><abbr title="United States">U.S.</abbr></a>
Demo 3 does not because you're trying to put markup into a title= attribute:
<abbr title="[[#Alphabet|Latin alphabet]]">ABC</abbr>
which will never work: the title= attribute can only be plain text (possibly including newlines). --Redrose64 (talk) 15:34, 4 November 2014 (UTC)
Thx, so technically it is sound. Next, is it Good Design, or a hack to avoid? -DePiep (talk) 16:41, 4 November 2014 (UTC)
Strictly speaking, it is technically valid, but I have never seen the two combined before, and I would not advice such a construct. The visual aspect is confusing enough (is it a link or a hint?), and with popups enabled it is even more of a mess. -- [[User:Edokter]] {{talk}} 16:47, 4 November 2014 (UTC)
There is another way, not mentioned so far: {{abbr|[[#ToUSanchor|U.S.]]|United States}}U.S.
<abbr title="United States"><a href="#ToUSanchor">U.S.</a></abbr>
like demo 3 it puts the <abbr>...</abbr> element outside but doesn't misuse its title= attribute. --Redrose64 (talk) 16:59, 4 November 2014 (UTC)
FYI: There are over 50,000 users who will never see the abbreviation since we have either popups or Hovercards enabled. We see only the linked article. --  Gadget850 talk 17:38, 4 November 2014 (UTC)
I have Popups and I see the hints as well, but they sometimes overlap. -- [[User:Edokter]] {{talk}} 17:41, 4 November 2014 (UTC)
User:Gadget850, is this note still valid? With Hovercards I see both in two layers (expanded abbr on top). -DePiep (talk) 20:34, 4 November 2014 (UTC)
That does not work; the title is empty. -- [[User:Edokter]] {{talk}} 17:41, 4 November 2014 (UTC)
It shows for me; if the <a>...</a> has no title, the title of the parent element (in this case <abbr>...</abbr>) is used, see title= attribute, rule 3. --Redrose64 (talk) 17:53, 4 November 2014 (UTC)
The hint only shows for me when I hover over the dotted underline, not on the link itself. Popups keeps adding an empty title to the link, making it disappear. -- [[User:Edokter]] {{talk}} 18:15, 4 November 2014 (UTC)
With me, the hint (expanded abbr) shows on the forground of Hovercards (like a tooltip). So it is there correctly, but it is not a nice view. Will have to look at WP:POPUPS?
FYI, applied in this Template:Kennedy family tree/sandbox. The in-page jumping makes sense there. -DePiep (talk) 20:34, 4 November 2014 (UTC)
I still think we should not combine links with abbreviations. They each have their own cursor; now the link does not show its cursor. -- [[User:Edokter]] {{talk}} 21:10, 4 November 2014 (UTC)
Hovercards also interferes with the title attribute.
I have noted this at mw:Talk:Beta_Features/Hovercards. The solution/answer might be relevant for abbr too. -DePiep (talk) 12:16, 5 November 2014 (UTC)
Results

I have talkerd about this at mw:Topic on Talk:Beta Features/Hovercard. Results:

Correctly nesting code to add a title wrt hovercards:

[[Main page|<span title="Let's add a title">wiki M.P.</span>]]wiki M.P.

No objections from that level to combine link & abbr
Current usage: in infobox {{chembox}}, Category:R-phrase_templates like {{R36}}.
I conclude: not (to be) prohibited. -DePiep (talk) 21:37, 1 December 2014 (UTC)
Now, it is not recognizable as a link. They should not be combined. -- [[User:Edokter]] {{talk}} 23:32, 1 December 2014 (UTC)
? With me it looks OK. Note that there are multiple results. One is about interaction between hovercards and tooltip. Second is {{R36}}. In general, w3c trumps hovercards (and they don't contradict). -DePiep (talk) 23:37, 1 December 2014 (UTC)
The R36 link does not show a pointing hand, so it does not look like a link. <a> and <abbr> are not compatible and clash over presentation; the cursor: help; (set by MediaWiki) overrides cursor: pointer; (set by client), hence they should not be combined. Please remove this construct. -- [[User:Edokter]] {{talk}} 09:38, 2 December 2014 (UTC)

Styling (2)

Please note a discussion which may affect the styling of this template, at Wikipedia:Templates for discussion/Log/2015 July 28#Template:Discreet abbreviation. You contributions will be welcome. Andy Mabbett (Pigsonthewing); Talk to Andy; Andy's edits 11:05, 28 July 2015 (UTC)

Mobile

we need something to help mobile users to use this template as well since they cannot get the meaning of the work since mobile browsers have no hover much less a tooltip and as I tested in Firefox and Chrome for Android there doesnt seem to be any other thing to accomplish for the lack of a hover and tooltip feature. I would say that is the browser is a mobile browser then we have 2 options:

a) display only the written out thing

b) use () to indicate what it means like "UK (United Kingdom)".

My1 09:33, 23 September 2015 (UTC)

Quotes in meaning

The meaning text goes into an HTML attribute, so it is passed through nowiki; however, this preserves double quotes which then interferes with the output HTML. Please either specifically handle quotes, converting to HTML entities, in the meaning text, or throw an error. I have seen this error missed in articles, and there is nothing specific in the documentation about it. 217.28.6.255 (talk) 02:39, 15 July 2016 (UTC)

Good catch, let me fiddle with it in the sandbox. Matt Fitzpatrick (talk) 03:38, 15 July 2016 (UTC)
If you get a chance, please check Template:Abbr/testcases and let me know if the sandbox version fixes the problem. I can go ahead and make the edit if all looks well. Matt Fitzpatrick (talk) 03:50, 15 July 2016 (UTC)
  Done Seems to be working. Please feel free to reopen the request if there are still problems. Matt Fitzpatrick (talk) 22:04, 15 July 2016 (UTC)

Template-protected edit request on 29 July 2016

babsson 20:31, 29 July 2016 (UTC) my request is about to now mor about edit so i'm hear to understand i need it i now i'm not perpect so i whant to be — Preceding unsigned comment added by Ibrahim sulaiman babawoo (talkcontribs) 21:31, 29 July 2016‎

Your request is unclear. Andy Mabbett (Pigsonthewing); Talk to Andy; Andy's edits 21:19, 29 July 2016 (UTC)

Help me

 

Does the toll support wikilinks and images. I mean can i type {{abbr|[[File:Dubai.png|link=]]|Mean Sea Level Pressure}} — Preceding unsigned comment added by VarunFEB2003 (talkcontribs) 16:23, 30 July 2016‎

@VarunFEB2003: As can be seen from the above, that (with added thumb parameter) gives the HTML output:

<div class="thumbinner" style="width:302px;"><abbr title="Mean Sea Level Pressure"><img alt="Dubai.png" src="//upload.wikimedia.org/wikipedia/commons/thumb/2/28/Dubai.png/300px-Dubai.png" class="thumbimage" srcset="//upload.wikimedia.org/wikipedia/commons/thumb/2/28/Dubai.png/450px-Dubai.png 1.5x, //upload.wikimedia.org/wikipedia/commons/thumb/2/28/Dubai.png/600px-Dubai.png 2x" data-file-width="981" data-file-height="841" height="257" width="300"></abbr>
<div class="thumbcaption">
<div class="magnify"><abbr title="Mean Sea Level Pressure"><a href="/wiki/File:Dubai.png" class="internal" title="Enlarge"></a></abbr></div>
</div>
</div>

But since the image is not an abbreviation for "Mean Sea Level Pressure", that's nonsensical. Andy Mabbett (Pigsonthewing); Talk to Andy; Andy's edits 15:49, 30 July 2016 (UTC)

@Andy Mabbett: ya thanks, that was just an example i thought of. Obviously I am not gonna use it like that. Thanks a lot. VarunFEB2003 (talk) 16:50, 30 July 2016 (UTC)

At least one error

There were seemingly some similarities between the functionality of this template and the old Template:Tooltip, although they were intended for different purposes. However, that template since long time is a redirect to the template Abbr.

On the other hand, the documentation for Abbr does make it very clear that Abbr is not supposed to be employed for other purposes than expansion of abbreviations and acronyms. I checked that there were similar warnings also seven years ago, when the redirect was effectuated (although the exact warning formulation has changed a bit).

In other words: The template Tooltip, which constructed a "hoover text" without using the html <abbr> construct was replaced by a redirect to the functionally similar template Abbr, which uses that construct; but we are 'forbidden' to use this template for creating general tooltips, according to its documentation. At least one thing must be wrong: Either the redirect that implicitly tells us that general tooltips should be produced by a template employing <abbr>, or the documentation that tells us that a template employing <abbr> never should be used for creating general tooltips. JoergenB (talk) 12:21, 2 September 2017 (UTC)

I made as much sense as I could out of this complicated situation, and added a more direct warning for mistakenly using this as a tooltip, just because the template tooltip redirects here. The warning itself duplicates the more precise warning further down. However, quite a number of users might believe that a template with a synonym name Tooltip might be employed to create a tooltip, without reading on to the more detailed information. JoergenB (talk) 17:15, 10 September 2017 (UTC)

Class parameter

I'd like to add a |class= parameter, as in this self-reverted edit, but I'm not sure how to do so, when the other parameters are unnamed. Can someone assist, please? — Preceding unsigned comment added by Pigsonthewing (talkcontribs) 09:39, 26 May 2010 (UTC)

(an old post, let me give it a datestamp for the archiving:) -DePiep (talk) 20:39, 10 October 2017 (UTC)

Add class=country-name

The documentation demonstrates adding |class=country-name. Is that stil a used and useful option, to be promoted? -DePiep (talk) 19:08, 9 October 2017 (UTC)

It modifies the class of the <abbr>...</abbr> tags used in the template, so it is still an optional part of the template. Primefac (talk) 20:43, 9 October 2017 (UTC)
I meant to ask: does adding this class name have any effect? (Couldn't find it in common.css etc, for example). (Or am I misunderstanding classes?) -DePiep (talk) 21:01, 9 October 2017 (UTC)
Yeah, depending on how some people set up their CSS a country class will display differently than a non-country class. Who these people are I don't know, but I know some people set their css up like that. Primefac (talk) 00:22, 10 October 2017 (UTC)
OK, I'll add it. -DePiep (talk) 07:09, 10 October 2017 (UTC)
A value in a class= attribute can cause the invocation of a rule defined in a style sheet, or of a function defined in some JavaScript; but it doesn't have to do either. It is not an error for a class name to be used in the HTML of a page and yet appear in no style sheets or scripts at all. Classes are merely a way of associating one or more objects having some relationship: so if we scan through a page source looking for <abbr> tags with the class= attribute, and pick out only those where the value-list of that attribute includes country-name, this should reveal abbreviations having a related purpose (presumably, the abbreviation of the name of a country); and any other abbreviations would be passed over by that scan. --Redrose64 🌹 (talk) 11:09, 10 October 2017 (UTC)
As I expected it to be, thx. So when adding a class, we are talking "into the blind" as the olds communication expression goes (i.e., without certainty of being received). Like with those Apollo things. I also get that it's not just css-style involved (commons.css), but semantics too. I have some templates to update. BTW, is there a better way to search for sensible class names? (looks like F3-ing "commons.css" is not optimal). -DePiep (talk) 20:34, 10 October 2017 (UTC)
Edited {{Infobox drug}}, like [[1]]. -DePiep (talk) 22:47, 10 October 2017 (UTC)
You're not likely to find anything useful by searching for "commons.css". If you mean that you are going to search in a file named "commons.css", that's unlikely to succeed, since there are only five such pages, all in User: space - and four of those are probably misnamed. Page names that are recognised include MediaWiki:Common.css and User:Example/common.css but of course the latter will be user-specific.
The thing to search for is the class name; do so mainly in MediaWiki: namespace, but you'll also need to search User: space too. Don't forget the same namespaces on meta:. Even this won't pick up anything defined in the MediaWiki software itself. --Redrose64 🌹 (talk) 16:13, 11 October 2017 (UTC)

Better examples needed

  • The Usage section includes three parameters whose meaning is (somewhat) explained, but whose purpose will be extremely opaque to those of us who don't write much HTML or CSS markup:

Named parameters:

class
Adds a CSS class.
id
Adds a HTML id; this must be unique on the entire page.
style
Adds a style attribute.
  • I'm guessing that "style" in this context means a style defined in the relevant HTML – whether explicitly, or inherited from a definition in the relevant CSS. Could some body please clarify this?
  • The Examples that follow the Usage section include just one that adds a value for each of class and id, but none for style; nor is it clear what difference this would make to how the code will be rendered for any "Jane Doe" reader who uses the default Wikipedia settings for CSS etc. So the examples completely fail to clarify why these parameters are available, and why they are valuable – that is, how an editor could use them to improve Wikipedia. Please provide some instructive examples, that show how they change the rendering of a Wikipedia article.

yoyo (talk) 14:32, 4 March 2018 (UTC)

TemplateData parameters

The TemplateData for {{Abbr}} has several parameters, each of which corresponds to a positional (unnamed) or named parameter of the {{Abbr}} template markup. However, the template includes style as a named parameter, but style does not also appear as a TemplateData parameter. Is this omission accidental or deliberate?

I'm thinking that if the parameters id and class are of interest to various reporting tools, then style probably is, too. And why would the VisualEditor not make use of any defined HTML style? yoyo (talk) 14:51, 4 March 2018 (UTC)

Tooltip in RfD

One month late, but people would likely be interested in this discussion on {{Tooltip}} Galobtter (pingó mió) 09:27, 9 May 2018 (UTC)

The discussion has now been closed. The result was to deprecate {{Tooltip}} as follows:
  1. All uses will be reviewed for appropriateness under Wikipedia:Manual of Style/Accessibility#Text.
  2. Appropriate uses should be converted to use {{Abbr}}; Any non-abbreviations should be removed or replaced with footnotes.
Any assistance would be appreciated. ~ Amory (utc) 17:59, 19 May 2018 (UTC)

This template will not work with a link if the link is inside the template, rather than surrounding it.

  • If it's around the abbreviation value, the tooltip does not work.
  • If it's around the tooltip text, this is invalid markup, since that material can only be plain text.

I've updated the documentation to reflect this, but there are thousands of cases of {{abbr|[[Article on bazzquux|Foo]]|bazzquux}} that need to be fixed, and ideally we'd detect both of the bad link conditions and throw an error after that cleanup is done, the way the citation templates and various others throw big red errors if you try to do something wrongheaded with them. This kind of detection code might require a Lua module instead of old-school wiki-template code.  — SMcCandlish ¢ 😼  01:56, 13 June 2018 (UTC)

You can use {{delink}} to remove links from text. {{3x|p}}ery (talk) 02:41, 13 June 2018 (UTC)
I believe I've implemented what you're asking for in the sandbox, which produces an error category and silently removes the link whenever a link is specified in either parameter. {{3x|p}}ery (talk) 02:46, 13 June 2018 (UTC)
Schweet.  — SMcCandlish ¢ 😼  00:52, 14 June 2018 (UTC)

Resolving Template:Abbr and Template:Hover_title issues

  FYI
 – Pointer to relevant discussions elsewhere.

Please see the issues raised at Template talk:Hover title#Other Options, and Template talk:Hover title#Reverse the parameters?

  • The first is an accessibility issue that might need to be addressed by some CSS/JS combination or something. Progress is stuck for the moment, likely due to just insufficient input.
  • The latter is about making these two templates' parameters cross-compatible. I'm not sure what the best approach is for the latter one. Maybe creating a temporary copy of {{Hover title}}; changing all calls to that template to call the temp version; changing the parameters in the non-temp version, migrating the extant template calls to the new syntax and to point back to the real template, then speedily delete the temp copy.

The issues relate to each other conceptually but not very technically. Maybe a bot or something can help with the second issue; while the deployment level of that template is orders of magnitude smaller than that of {{Abbr}}, it's still thousands of pages. It'll eventually be many more, since all uses of {{Abbr}} that are not for abbreviations need to migrate to {{Hover title}} (whether or not accessibility perfection is achieved yet – it's also an accessibility problem and a standards-compliance/HTML validity problem to abuse <abbr> markup for general tooltips that have nothing to do with abbreviations).

Anyway, it's probably better discussed at the extant threads at Template talk:Hover title. I just want people who watch this template to be aware of the related stuff at that one. @Pppery, Redrose64, Dodoïste, Pi3832, MSGJ, and Graham87: pinging a few previous respondents.  — SMcCandlish ¢ 😼  02:49, 14 June 2018 (UTC)

Template-protected edit request on 12 September 2018

Naomi Osaka is a professional tennis player representing Haiti and Japan. Reasonbmor69 (talk) 00:34, 12 September 2018 (UTC)

  Not done: this is the talk page for discussing improvements to the template {{Abbr}}. Please make your request at the talk page for the article concerned. Primefac (talk) 00:38, 12 September 2018 (UTC)

Please remove all posibble spaces or fix other way (maybe Phab) problem that one space is displayed in Google search when displaying hover text of this template (because hover cannot be performed there, meaning is displayed i.e. hover text and not abbrev). I hope it is not a Google search problem itself, that it interprets abbr tags as with one extra space needed before displayed text.

I hope you will see first search result here (note that девојачки is spaced from left parenthesis with no reason i.e. it is wrong). Note also that I've removed spaces in sr.wiki template in hope that problematic space will dissappear but it has not yet. --5.43.99.155 (talk) 01:39, 26 September 2019 (UTC)

There are no extraneous spaces; the markup and parser functions go directly from the > of <abbr> to the opening {{ of the switch statement, then back to the </abbr> immediately after the switch closes with }}. I would guess this is a Google thing. Primefac (talk) 02:46, 27 September 2019 (UTC)

Displaying strangely

For some reason, this template results in strange appearances on my Windows 10 machine. With the Cora template, for example, it looks a bit like ".c," but not quite - something funny is going on. This is the same on Google Chrome and Microsoft Edge. On Internet Explorer, it's a bit different - it seems that it's "c." with three dots just underneath it. Is this something other people see? If so, is anyone able to fix it, please? These are standard browsers so I’d hope this can be made to work OK? Thanks in advance - The Parson's Cat (talk) 21:37, 2 August 2020 (UTC)

I see {{circa}} as it should display (e.g. c. 2020) on Firefox. I'm thinking this might be a browser/computer issue on the OP's end, since {{abbr}} hasn't changed since 2016. Primefac (talk) 21:50, 2 August 2020 (UTC)
Whether the underline appears solid or dotted, the number and size of dots, and the position of the underline relative to the underlined text will all depend upon one or more of several factors: the fonts that are installed on your machine; the fonts that are bundled with your browser; how the browser interprets the <abbr>...</abbr> element, the attribute selector, the border-bottom: 1px dotted; declaration and the text-decoration: underline dotted; declaration (not all recent browsers recognise this last one). Whilst all modern browsers recognise most of these constructs, they may do so in differing ways. Whichever one of these factors it is, this is a client-side issue and nothing that we can do anything about. --Redrose64 🌹 (talk) 11:54, 3 August 2020 (UTC)
Thanks for all your help. A quick bit of investigation suggests that if you have your browser 'Scale and layout' sizing in Windows 10 set to anything other than 100%, you will see problems in Chrome and Edge. Looking at the code snippet above, I can't help wondering if it's that "1px dotted" that is the problem - it's an absolute measurement rather than a relative one. I wonder if the same equivalent-nominal value in 'em' units rather than 'px' would fix the problem? Is this something that might be worth a try, please? The Parson's Cat (talk) 12:47, 4 August 2020 (UTC)

Remove third parameter

Please apply the sandbox (diff). It removes the third parameter function, which is unused (as far as evident by searching for hastemplate:abbr hastemplate:IPA insource:/\{\{([Aa]bbr|[Aa]bbreviation|[Aa]bbrv|[Aa]br|[Dd]efine|[Dd]escrizione[ _]comando|[Mm]ousetext|[Tt]ool[ _]tip|[Tt]ooltip|[Ww]hat[ _]is)[^\}]*\| *(3 *= *)?(i|IPA) *[\|\}]/) and was inapprorpriate in the first place, since not only {{IPA|{{abbr|foo|bar}}}} does the job perfectly (foo), the function never worked because the tooltip of {{IPA}} overrides the tooltip produced by {{abbr}}: {{abbr|foo|bar|i}}foo (<abbr title="bar"><span title="Representation in the International Phonetic Alphabet (IPA)" class="IPA">foo</span></abbr>). Nardog (talk) 03:23, 2 September 2020 (UTC)

Incidentally, this also fixes the error demonstrated in Template:Abbr/testcases#Tests with lint errors (real-life examples: Tales from the Mos Eisley Cantina#Contents, List of songs recorded by Iggy Azalea#Songs). Nardog (talk) 08:39, 2 September 2020 (UTC)

  Done Primefac (talk) 09:46, 2 September 2020 (UTC)

Mobile display

On mobile devices, this template displays the underline, but doesn't appear to display the hovertext. Could we make it so that tapping it on mobile would cause a pop-up of some sort with the hovertext? {{u|Sdkb}}talk 00:39, 15 September 2020 (UTC)

@My1:, it appears you raised this issue back in 2015. {{u|Sdkb}}talk 00:41, 15 September 2020 (UTC)

You can use Reference Tooltips. Nardog (talk) 19:22, 1 October 2020 (UTC)
Nardog, could you clarify? Are reference tooltips enabled by default here (I'm not concerned for myself, but for the default), and how would they be invoked here? {{u|Sdkb}}talk 19:30, 1 October 2020 (UTC)
It's enabled, but not for non-reference tooltips it seems, so you'd have to click on the cogwheel while hovering over a reference and check "Show tooltips over text with a dotted underline...". Nardog (talk) 22:42, 1 October 2020 (UTC)

Taken to pump

  You are invited to join the discussion at Wikipedia:Village pump (technical) § Template:Abbr mobile display. {{u|Sdkb}}talk 20:38, 12 October 2020 (UTC)

Linking must be done in a particular way, still

@SMcCandlish: I don't know what "Chrome bug" or "fix" you're talking about. When logged out, only the "compatible" one in the "TKO" examples works as intended, with both the browser built-in tooltip and the page preview popping up, while in the second only the page preview shows up. If you disable the page preview, the default MW-generated tooltip ("Knockout") appears in the second example. (The only way the second example works AFAICT is if you've enabled Reference Tooltips' "Show tooltips over text with dotted lines" option.) The previous documentation is correct. Tested on both Chrome and Firefox. Nardog (talk) 01:18, 16 December 2020 (UTC)

Noted. Will dig into it more. Reverted the /doc material.  — SMcCandlish ¢ 😼  07:24, 16 December 2020 (UTC)