Template:Glossary/doc
Usage
The {{glossary}} template is used with {{Glossary end}}
to explicitly bracket a glossary or glossary-like description list (also called a definition list or association list). This is a good practice anywhere description/definition lists are used for defining large lists of technical terms. The template pair invoke the <dl>...</dl>
description list HTML element.
The pair of templates incidentally prevent Kodi Wiki'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}} {{Defn}} {{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. 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-delimited CSS classes on to the<dl>
element, in addition to the automatically included classglossary
. There is rarely any reason to do this, either.
Examples
This shows both a very simple then a rather complex instance in a structured glossary (including an entry with a block quotation):
== A–M == {{Glossary}} {{Term|1=applesnorkel}} {{Defn|1=Definition of first term.}} {{Term|term=arglefarst|content=''arglefarst''{{Anchor|argle-farst|argle farst}}}} {{Defn|num=1|defn=Beginning of first definition of second term <blockquote class="templatequote glossary-blockquote" style="line-height: 1.5em; margin: 0 0 -1.35em; overflow: hidden; padding: 0 0 1.6em 2.5em; text-align: left;">Block quotation in first definition of second term.</blockquote> Conclusion of first definition of second term. }} {{Defn|num=2|defn=Second definition of second term.}} {{Glossary end}} |
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.