Template:Abbr

From Angelina Jordan Wiki
Revision as of 05:04, 18 October 2020 by Dcljr (talk | contribs) (note limitation about checking input)

please specify an abbreviation and its expanded form in the template call

Documentation

This template provides a simple interface to the <abbr> HTML element. It should not be used for anything except abbreviations (including acronyms and initialisms). In particular, it should not be used merely for its side-effect (for most readers) of rendering text in a "tooltip". If that is needed for some reason, a different template can be created.

The template complains when it finds no input at all, as seen above, but not when only the expanded form is missing (because this wiki does not yet have the parser functions needed to implement such a check).

Usage

  • {{abbr|abbreviation|expanded form}}

Example

  • {{abbr|NOK|Norwegian krone}}NOK

Hover on "NOK" to see how the expanded form is displayed. Usually it appears as a "tooltip".

Limitations

Links

The expanded-form text cannot contain any links. If it does, the wiki markup to create the link will instead be rendered as plain text:

  • {{abbr|NOK|[[wikipedia:Norwegian krone|Norwegian krone]]}}NOK

(Hover on "NOK" to see why this is not what you want.)

A simple workaround is to place the abbreviation inside the link instead of the other way around:

  • [[wikipedia:Norwegian krone|{{abbr|NOK|Norwegian krone}}]]NOK

Alternatively, you might be able to accomplish what you want by using a normal "piped" wikilink, since such links already show "tooltips" when they are hovered on. In such a case, the expanded form should be either an existing article or a redirect to one, as seen here:

  • [[Kringkastingsorkestret|KORK]]KORK

Markup

The expanded-form text can contain HTML character entities (such as &ouml; for the letter ö), but not HTML elements (such as <i>italics</i>) or wiki markup (such as ''italics''). If such markup is used, it will either be rendered as plain text or completely break the template call, as seen here:

  • {{abbr|CEIA|''Clarissa Explains It All''}}CEIA
  • {{abbr|CEIA|<i>Clarissa Explains It All</i>}} ⇒ <abbr title="Clarissa Explains It All">CEIA

Fortunately, there shouldn't be any real need for special styles in the expanded-form text.