Template:Term/doc: Difference between revisions
| [checked revision] | [checked revision] |
Caleb Cooper (talk | contribs) m Text replacement - "[[WP:" to "[[Wikipedia:WP:" |
Caleb Cooper (talk | contribs) m Text replacement - "[[HTML" to "[[Wikipedia:HTML" |
||
| Line 3: | Line 3: | ||
=={{#ifeq:{{BASEPAGENAME}}|Term|Usage|[[Template:Term]]}}== |
=={{#ifeq:{{BASEPAGENAME}}|Term|Usage|[[Template:Term]]}}== |
||
{{#ifeq:{{BASEPAGENAME}}|Term|<!--nothing-->|{{collapse top|heading=Usage|left=y}} }} |
{{#ifeq:{{BASEPAGENAME}}|Term|<!--nothing-->|{{collapse top|heading=Usage|left=y}} }} |
||
The template {{tlx|term}} is used in [[Wikipedia:Manual of Style/Glossaries|template-structured glossaries]] to create terms to be defined, that are properly structured, have [[Separation of presentation and content|semantic value]], and can be linked to as if independent sections. It is a wrapper for {{tag|dt}}, the ''description list term'' [[HTML element#Lists|HTML element]]. The template has a mnemonic redirect at {{tlx|dt}}. |
The template {{tlx|term}} is used in [[Wikipedia:Manual of Style/Glossaries|template-structured glossaries]] to create terms to be defined, that are properly structured, have [[Separation of presentation and content|semantic value]], and can be linked to as if independent sections. It is a wrapper for {{tag|dt}}, the ''description list term'' [[Wikipedia:HTML element#Lists|HTML element]]. The template has a mnemonic redirect at {{tlx|dt}}. |
||
Basic usage: |
Basic usage: |
||
| Line 274: | Line 274: | ||
|{{fake heading|Technical details|sub=3}} }} |
|{{fake heading|Technical details|sub=3}} }} |
||
What this template does on the technical level is wrap the {{var|term}} in the {{tag|dfn}} [[HTML element]] to semantically mark the term as the {{em|defining instance}} on the page of the defined term, and puts this marked-up content inside a {{tag|dt}} ''term'' element of a {{tag|dl}} description list (a.k.a. definition list, association list; the list is generated by the {{tlx|glossary}} and {{tlx|glossary end}} templates), and gives CSS <code>class="glossary"</code> to the {{tag|dt|o}} element. That class isn't doing anything yet, but it could later, like a slight font size increase. |
What this template does on the technical level is wrap the {{var|term}} in the {{tag|dfn}} [[Wikipedia:HTML element]] to semantically mark the term as the {{em|defining instance}} on the page of the defined term, and puts this marked-up content inside a {{tag|dt}} ''term'' element of a {{tag|dl}} description list (a.k.a. definition list, association list; the list is generated by the {{tlx|glossary}} and {{tlx|glossary end}} templates), and gives CSS <code>class="glossary"</code> to the {{tag|dt|o}} element. That class isn't doing anything yet, but it could later, like a slight font size increase. |
||
{{#ifeq:{{BASEPAGENAME}}|Term| |
{{#ifeq:{{BASEPAGENAME}}|Term| |
||
Latest revision as of 16:22, 21 October 2020
| This page was automatically imported from Commons any changes will be overwritten, the source page is here () |
Template:Term
Usage
| ||||||||
|---|---|---|---|---|---|---|---|---|
|
The template Basic usage: Template:Gray {{term|1=term}} Template:Gray Template:Gray Inline templates, reference citations, wikimarkup styles, etc., can be applied to the term in the second parameter (
More complex usage is typically: or or If the second or
Style cannot be applied around the template, either, as it is a container for content (the term), not content itself (and doing so will produce invalid markup that will have unpredictable results depending upon browser):
For the same reasons that links to other pages are discouraged in headings, links are discouraged in glossary terms:
Again, as with the first parameter (the term) itself, if the " numbered: or named:
If your glossary has an unusual case in which one entry and another share the exact same name except for case (thus would get the same lower-cased HTML {{term|term=foo}}
{{defn|Definition of lower-case version here ...
{{term|term=Foo |id=Foo_2 |content={{vanchor|Foo}} }}
{{defn|Definition of proper-name version here ...
You can then link to them as The template As with styled terms, the first parameter must be used to provide the "bare" term, the second to provide this extra markup. It is not necessary to add the term itself to the By contrast, when using semicolon-delimited terms in unstructured glossaries, the term does need to be added explicitly as an anchor if link anchorage is desired (which is almost always the case): or use (Strictly speaking, this fact has nothing to do with this template, but may be of use to editors who are converting from one glossary style to the other.) Two or more Example: {{term|1=aspirin}}
{{defn|1=A mild analgesic of the non-steroidal anti-inflammatory drug (NSAID) family...}}
{{term|1=heroin}}
{{term|1=diacetylmorphine |multi=y}}
{{term|1=diamorpine |multi=y}}
{{defn|1=A synthetic narcotic drug of the opiate family...}}
{{term|1=ranitidine}}
{{defn|1=An antacid of the proton pump inhibitor family...}}
To indicate the language of a non-English term, use the This shows no visual change for most languages: For all non-English languages this provides many metadata features, but it is essential for those that do not use the Latin alphabet, so that the content displays properly in various browsers. If it is useful to indicate the name of the language, there are individual templates for most languages, with names based on the ISO codes, and which automatically italicize the foreign content: which renders as:
As detailed above, two or more terms, as variations or alternatives, can share definitions. The most common use case for this is presenting the term in two variants of English. Example: {{term|1=tyre|content={{lang-en-GB|tyre}} }}
{{term|1=tire|content={{lang-en-US|tire}} |multi=y}}
{{defn|1=A resilient wheel covering usually made of vulcanized rubber.}}
Note the use of Result: Template:Blockindent In a different format, more appropriate for alphabetical glossaries: {{term|1=tyre|content={{lang|en-GB|tyre}} {{small|([[British English]])}} }}
{{term|1=tire|content={{lang|en-US|tire}} {{small|([[American English]])}} |multi=y}}
{{defn|1=A resilient wheel covering usually made of vulcanized rubber.}}
Result: That example uses the The The HTML5 update:
Most of the restrictions on the content of
id have been removed, so id values no longer have to begin with an [a-z][A-Z] alphabetic character, avoid most punctuation marks, or suffer other such limitations. Wikipedia's MediaWiki engine is smart enough to auto-escape any problematic characters, on the fly.|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 .
The This shows both a very simple then a rather complex instance:
Images, hatnotes and other "add-in" content intended to immediately follow the
What this template does on the technical level is wrap the term in the |
