Difference between revisions of "Template:Abbr/doc"

From Discworld MUD Wiki
Jump to: navigation, search
(remove broken offwiki links)
(issues)
Line 3: Line 3:
  
 
<!-- PLEASE ADD CATEGORIES AND INTERWIKIS AT THE BOTTOM OF THIS PAGE -->
 
<!-- PLEASE ADD CATEGORIES AND INTERWIKIS AT THE BOTTOM OF THIS PAGE -->
{{tl|abbr}} is an '''abbreviation''' template. It works similarly to the [[HTML]] &lt;abbr> or &lt;acronym> tags.
+
{{tl|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]] &lt;abbr> or &lt;acronym> tags.
  
 
== Usage ==
 
== Usage ==
Line 10: Line 10:
 
#The ''long form'', which many web browsers show as a tooltip when a user Mouseover|hovers over the text.
 
#The ''long form'', which many web browsers show as a tooltip when a user Mouseover|hovers over the text.
  
=== Example ===
+
== Example ==
 
<pre>{{abbr
 
<pre>{{abbr
 
  |MSLP
 
  |MSLP
Line 16: Line 16:
 
}}</pre>
 
}}</pre>
  
appears as {{abbr|MSLP|Mean Sea Level Pressure}}. When hovering over the text, <span style="border: black 1px solid;padding:2px;background-color:#fffbe7;font-size:.9em">Mean Sea Level Pressure</span> will appear as a tooltip.
+
This appears as {{abbr|MSLP|Mean Sea Level Pressure}}. When hovering over the text, <span style="border: black 1px solid;padding:2px;background-color:#fffbe7;font-size:.9em">Mean Sea Level Pressure</span> will appear as a tooltip.
 +
 
 +
== Issues ==
 +
If using {{tl|Abbr}} {{tl|Abbrl}} or {{tl|Abbrlink}} inside a table then it breaks the table if there are end lines in the template and there other columns on the same line after the template.
 +
 
 +
How to solve issues (pick one):
 +
*Either start the next column on another line:
 +
<pre>
 +
|-
 +
| {{Abbr|AM|Ankh-Morpork,
 +
Ankh-Morpork,
 +
the city so good they called it Ankh-Morpork}}
 +
| other column
 +
</pre>
 +
*or remove endlines in the the {{tl|Abbr}} {{tl|Abbrl}} or {{tl|Abbrlink}} template:
 +
<pre>
 +
|-
 +
| {{Abbr|AM|Ankh-Morpork, Ankh-Morpork, the city so good they called it Ankh-Morpork}} || other column
 +
</pre>
 +
 
 +
Things to avoid: endlines in {{tl|Abbr}} {{tl|Abbrl}} or {{tl|Abbrlink}} template followed on the same line by one or more columns
 +
<pre>
 +
|-
 +
| {{Abbr|AM|Ankh-Morpork,
 +
Ankh-Morpork,
 +
the city so good they called it Ankh-Morpork}} || other column
 +
</pre>
  
 
== See also==
 
== See also==
 
*[[Template:Abbrl]] - like Abbr but also wikilinks to the abbreviated name.
 
*[[Template:Abbrl]] - like Abbr but also wikilinks to the abbreviated name.
 
*[[Template:Abbrlink]] - like Abbr but also wikilinks to the expanded name.
 
*[[Template:Abbrlink]] - like Abbr but also wikilinks to the expanded name.

Revision as of 23:29, 22 May 2022

 

{{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.

Issues

If using {{Abbr}} {{Abbrl}} or {{Abbrlink}} inside a table then it breaks the table if there are end lines in the template and there other columns on the same line after the template.

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
|-
| {{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