Template:Glossary

From Wikipedia, the free encyclopedia
  (Redirected from Template:Gloss)
Jump to: navigation, search
Documentation icon Template documentation[view] [edit] [history] [purge]

Usage[edit]

The template {{glossary}} is used with {{glossary end}} to explicitly bracket a glossary or glossary-like description list (also called a definition list or association list), especially in a template-structured glossary, although such lists can be used more generally. This is required for template-structured glossaries, and is good practice anywhere description/definition lists are used for glossaries. The template pair invoke the <dl>...</dl> description list HTML element. Unfortunately, the {{dl}} mnemonic is not available as a redirect as of this writing.

The pair of templates incidentally prevent Wikipedia's MediaWiki software engine from auto-creating redundant definition list code (<dl>...</dl>) around terms and definitions if they have blank lines between them, as they often do, especially in non-structured glossaries.

Typical usage:

{{glossary}}
{{term|1=term}}
{{defn|1=Definition.}}
{{glossary end}}

Parameters

  • |id=   can be used to assign a one-word ID name to the glossary. This can be used as a #id link target, and could have other metadata uses.
  • |style=   will pass CSS styling on to the <dl> element. I.e., this styles the definition list itself, as a container, not the individual terms and definitions with it. There is rarely any reason to do this.
  • |class=   will pass one or more space-separate CSS classes on to <dl> element, in addition to the automatically included class glossary. There is rarely any reason to do this.

Examples

This shows both a very simple then a rather complex instance in a structured glossary (including an entry with a block quotation, using the glossary block quotation template, {{gbq}}):

==A–M==

{{glossary}}

{{term|1=applesnorkel}}
{{defn|1=Definition of term 1.}}

{{term|term=arglefarst |content=''{{lang|xx|arglefarst}}''{{anchors|argle-farst|argle farst}} }}
{{defn|no=1 |defn=
Beginning of first definition of term 2
{{gbq|1=Block quotation in first definition of term 2.}}
Conclusion of first definition of term 2.
}}

{{defn|no=2 |defn=Second definition of term 2.}}

{{glossary end}}

A–M
applesnorkel
Definition of term 1.
arglefarst
1.  Beginning of first definition of term 2

Block quotation in first definition of term 2.

Conclusion of first definition of term 2.

2.  Second definition of term 2.

Scope

This family of templates, like the underlying definition list code, is primarily intended for definitional uses, but can have other applications. The HTML 4.01 Specification itself says:

Definition lists...generally consist of a series of term/definition pairs (although definition lists may have other applications). Thus, when advertising a product, one might use a definition list:

Lower cost
The new version of this product costs significantly less than the previous one!
Easier to use
We've changed the product so that it's much easier to use!
Safe for kids
You can leave your kids alone in a room with this product and they won't get hurt (not a guarantee).

Thus, editors should feel free to use definition list markup as an alternative to bulleted or numbered lists when the material is well-suited to definition list presentation.

Template:Term[edit]

The |id=parameter can be used to assign a one-word, case-sensitive ID name to term. It must be unique on the page. This can be used as another #link target, and could have other metadata uses. By default, the |term= a.k.a. |1= parameter is already set as the ID, and this should rarely be overridden, unless there are two identical terms on the same page creating conflicting IDs.Usually the {{anchor}}template is used to add more link targets to an entry (see #Wiki-styling and linking the term for details).

The |class= parameter will pass one or more space-separated CSS classes on to the <dt> element, in addition to the automatically included class glossary. There is rarely any reason to do this.

Examples

This shows both a very simple then a rather complex instance:

Images, hatnotes and other content

Images, hatnotes and other "add-in" content intended to immediately follow the {{term}} must be used at the top of (inside) the first {{defn}} of the {{term}}. They cannot be placed between the {{term}} and {{defn}} or it will break the glossary markup. Images can, of course, be placed elsewhere within the {{defn}}, and bottom-notes like {{more}} can be placed at the end of, but inside, a {{defn}}. When used with a multi-definition term, the definition in which the {{ghat}} appears must be manually numbered (usually 1&nbsp; ..., as shown in the example below).

{{glossary}}
{{term|1= colour ball |content=colour ball {{anchor|coloured ball|coloured balls|colour|colours|color ball}} }}
{{defn| 1=
[[File:Set of Snookerballs.png|thumb|right|150px|A complete set of snooker balls, with six '''colour balls'''.]]
{{ghat|Also '''coloured ball(s)''', '''colour(s)'''; American spelling '''color''' sometimes also used.}}
1.&nbsp; In [[snooker]], any of the {{cuegloss|object ball|object balls}} that are not {{cuegloss|red ball|reds}}.
}}
{{defn|no=2 |1=
In [[Blackball (pool)|blackball]], a generic, collective term for the red and yellow {{cuegloss|group|groups}} of object balls.
}}
{{glossary end}}

colour ball

Also coloured ball(s), colour(s); American spelling color sometimes also used.

A complete set of snooker balls, with six colour balls.

1.  In snooker, any of the object balls that are not reds.

2.  In blackball, a generic, collective term for the red and yellow groups of object balls.
Technical details

What this template does on the technical level is wrap the term in the <dfn>...</dfn> HTML element to semantically mark the term as the defining instance on the page of the defined term, and puts this marked-up content inside a <dt>...</dt> description list (a.k.a. definition list, association list) term element, with CSS class="glossary". That class isn't doing anything yet, but it could later, like the light font size increase.


Template:Defn[edit]

See also

  • {{glossary}} – Half of a template pair; uses <dl> with a class to open the structured glossary definition list that {{glossend}} closes.
  • {{glossary end}} – The other half of this template pair; uses </dl> to close the definition list that {{gloss}} opens.
  • {{term}} – The glossary term to which the {{defn}} definition applies; a customized <dt> with a class and an embedded <dfn>.
  • {{defn}} – The definition that applies to the {{term}}; uses <dd> with a class
  • {{ghat}} – a hatnote template properly formatted for the top of a {{defn}} definition
  • {{gbq}} – a block quotation template properly formatted for inclusion in a {{defn}} definition
  • {{glossary link}} – meta-template for creating shortcut templates for linking to definitions in specific glossaries
  • Wikipedia:Manual of Style/Glossaries