Template:Defn/doc

Usage
The template is used in template-structured glossaries to create definitions of terms. It is a wrapper for , the description list definition HTML element. The template has a mnemonic redirect at.

Basic usage:

Links, inline templates, reference citations, wikimarkup styles, etc., can be applied to the definition. Technically, the 1 part is optional if the content of the definition does not contain the "=" character, but as any editors can add content, including templates with this character in them, it is always safest to explicitly name the parameter. The 1 parameter can also be called defn for those who don't care for numeric parameters.
 * This will work:
 * This will work:
 * This will fail:

More complex usage might be:

where # gives a leading number for a definition in a list of definitions, and term_id provides the name of the term used in the template to which this definition pertains.

Images, hatnotes and other content
Images, hatnotes and other "add-in" content intended to immediately follow the  They  be placed between the  and  or it will break the glossary markup. Images can, of course, be placed elsewhere within the, and bottom-notes like can be placed at the ends of but  the content of s.

Multiple definitions for one term
If a single has multiple definitions, they are simply numbered with the parameter explicitly. Think of the parameter as standing for "nd or later definition". You can also call it no, if you prefer (from "No.") Example:

Because of the uneven length of definitions, it is usually more convenient to put the 2 before the 1 description:

or

This is a very robust method, because it permits complex content like block quotations, nested lists, {cross-reference hatnotes, and other block-level markup inside each definition. The definitions can also be independently linked.

Use of a "standard" hatnote with a numbered definition would require manual numbering or it would look weird. But this method is deprecated anyway. An example of forcing it to kinda work:

It's better to use the template, for glossary hatnotes, and put it inside the first (or most applicable) definition. This obviates creating a pseudo-definition to hold the hatnote, as shown above. (which uses Module:Hatnote inline) has some CSS adjustments to work better than and its derivatives, when used inside a definition.

Making the definition independently linkable
To enable a link directly to a specific definition, name the definition with its (or it must be the foo value, if any, used in ). This must be unique on the page for each term, but should be the same for multiple definitions of the same term). This is done with the 's term parameter. This will produce a -link target ID in the form , where the # is the number of the definition (see , above), defaulting to "1". Example:

Note that some characters in " have been converted on the fly by MediaWikia by the time it sends the ID to the browser as  . You can still link to it on this page as  (view page source and see for yourself – that link has  ).

The IDs blubbermonster-defn1, blubbermonster-defn2, and snorkelweasel_(noun)-defn1 are all individually linkable, e.g. as. This is especially useful for cross-references within the glossary, e.g.

To add more than one linkable anchor, use the anchor template at the beginning of the definition's content:

Languages
There is no lang parameter, as on English Wikipedia all definitions are necessarily in English. For uses of glossary markup for non-glossary purposes in which some content may be in a foreign language, use language templates. E.g. in a list of film title translations formatted using glossary markup:

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

Applying CSS styles to the definition
The style parameter will pass CSS styling on to the element, e.g. font-family:serif; or whatever. I.e., this styles the definition itself, not the term it applies to, other definitions, or the glossary as a whole. This feature is rarely if ever needed in articles, but can be useful elsewhere for things like matching custom user page style.

Other parameters
The id parameter can be used to assign a one-word, case-sensitive ID name to definition. It must be unique on the page. This can be used as a #link target, and could have other metadata uses. See the section for how to normally make a definition linkable. Probably the  reason to use this feature is if there are two terms with the same name on the page, which would result in conflicting IDs.

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