Template:Defn/doc

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 is typically:

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.

{{#ifeq:{{BASEPAGENAME}}|Defn|

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 more can be placed at the ends of but s. 

colour ball: Set of Snookerballs.png

In snooker, any of the s that are not.

{{#ifeq:{{BASEPAGENAME}}|Defn|

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:



blubbermonster: Lorem ipsum dolor sit amet. Consectetur adipisicing elit.

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 hatnote with a numbered definition requires manual numbering or it will look weird:

{{#ifeq:{{BASEPAGENAME}}|Defn|

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:



blubbermonster: Lorem ipsum dolor sit amet. Consectetur adipisicing elit. snorkelweasel (noun): Ut enim ad minim veniam

 HTML output:

 blubbermonster 

1.&#160;&#160;Lorem ipsum dolor sit amet.

2.&#160;&#160;Consectetur adipisicing elit.

 snorkelweasel (noun) 

Ut enim ad minim veniam

</dl>

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:

{{#ifeq:{{BASEPAGENAME}}|Defn|

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:

Titles of La Vie en Rose in various languages: French: La Vie en Rose English: Life in Pink ...

{{#ifeq:{{BASEPAGENAME}}|Defn|

Examples

 * }}

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

<td style="border: 1px solid black; vertical-align: top;">

applesnorkel: Definition of term 1.

arglefarst:

{{#ifeq:{{BASEPAGENAME}}|Defn|

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 defintiions, 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.

{{#ifeq:{{BASEPAGENAME}}|Defn|

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.

{{#ifeq:{{BASEPAGENAME}}|Defn| {{Glossary/doc}} {{Term/doc}}