Difference between revisions of "Template:Abbr"

From Discworld MUD Wiki
Jump to: navigation, search
(try more)
(\n ?)
Line 1: Line 1:
<span id="collapseleft" class="mw-collapsible mw-collapsed" style="white-space:wrap; border-bottom:1px dotted; overflow:auto;"><span>&nbsp;<span title="{{#tag:nowiki|{{#replace:{{{2}}}|
+
<span id="collapseleft" class="mw-collapsible mw-collapsed" style="white-space:wrap; border-bottom:1px dotted; overflow:auto;"><span>&nbsp;<span title="{{#tag:nowiki|{{#replace:{{{2}}}|\n|<nowiki> </nowiki>}}}}">{{{1}}}</span> </span><span class="mw-collapsible-content">{{{2}}}&nbsp;</span></span><noinclude>[[Category:Templates]]{{Documentation}}</noinclude>
|<nowiki> </nowiki>}}}}">{{{1}}}</span> </span><span class="mw-collapsible-content">{{{2}}}&nbsp;</span></span><noinclude>[[Category:Templates]]{{Documentation}}</noinclude>
+

Revision as of 23:24, 20 May 2022

 {{{1}}} {{{2}}} 

[edit]

Documentation
 

{{Abbr}} is an abbreviation template, but it is instead mostly used to keep long text from being shown unless interacted with. It works similarly to the HTML <abbr> or <acronym> tags.

Usage

{{abbr}} takes two unnamed parameters, in order:

  1. The short form, which shows as text on the page.
  2. The long form, which many web browsers show as a tooltip when a user Mouseover|hovers over the text.

Example

{{abbr
 |MSLP
 |Mean Sea Level Pressure
}}

This appears as  MSLP Mean Sea Level Pressure . When hovering over the text, Mean Sea Level Pressure will appear as a tooltip. This does not usually work on mobile browsers.

You can also click on Expand to see the expanded text. Affter you can click Collapse to hide it again.

Issues

If using {{Abbr}} {{Abbrl}} or {{Abbrlink}} inside a table, then if there are end lines in the template and there other columns on the same line after the template those columns won't show up properly.

How to solve issues (pick one):

  • Either start the next column on another line:
|-
| {{Abbr|AM|Ankh-Morpork,
Ankh-Morpork,
the city so good they called it Ankh-Morpork}}
| other column
  • or remove endlines in the the {{Abbr}} {{Abbrl}} or {{Abbrlink}} template:
|-
| {{Abbr|AM|Ankh-Morpork, Ankh-Morpork, the city so good they called it Ankh-Morpork}} || other column

Things to avoid: endlines in {{Abbr}} {{Abbrl}} or {{Abbrlink}} template followed on the same line by one or more columns

|-
| {{Abbr|AM|Ankh-Morpork,
Ankh-Morpork,
the city so good they called it Ankh-Morpork}} || other column

See also