Template:Term/doc: Difference between revisions

clean up
m (1 revision)
 
(clean up)
 
Line 4: Line 4:
== {{#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 [[Sarkarverse: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}}.


Basic usage:
Basic usage:
Line 31: Line 31:
|{{pseudoheading|Wiki-styling and linking the term|sub=3}} }}
|{{pseudoheading|Wiki-styling and linking the term|sub=3}} }}


If the second or {{para|content}} parameter is styled with wikimarkup, linked, or otherwise altered inside the template, the term <em>must</em> also be retained in unstyled form as the first or {{para|term}} parameter. Failing to do so will cause the template to malfunction, since it must have a "clean" term name to use as the <code>id</code> of the element, for linking purposes, among other reasons.  The order intentionally mirrors that of wikilinking (<code><nowiki>[[</nowiki><var>title</var>|<var>styled</var>]]</code>).
If the second or {{para|content}} parameter is styled with wikimarkup, linked, or otherwise altered inside the template, the term ''must'' also be retained in unstyled form as the first or {{para|term}} parameter. Failing to do so will cause the template to malfunction, since it must have a "clean" term name to use as the <code>id</code> of the element, for linking purposes, among other reasons.  The order intentionally mirrors that of wikilinking (<code><nowiki>[[</nowiki><var>title</var>|<var>styled</var>]]</code>).
*Correct: {{bxt| {{tlnull|term|1{{=}}esprit de corps |<nowiki>''esprit de corps''</nowiki>}} }}
*Correct: {{bxt| {{tlnull|term|1{{=}}esprit de corps |<nowiki>''esprit de corps''</nowiki>}} }}
*Wrong: {{!bxt| {{tlnull|term|1{{=}}<nowiki>''esprit de corps''</nowiki>}} }}
*Wrong: {{!bxt| {{tlnull|term|1{{=}}<nowiki>''esprit de corps''</nowiki>}} }}
Style cannot be applied <em>around</em> 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):
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):
*Wrong: {{!bxt| <code><nowiki>''</nowiki>{{tlnull|term|1{{=}}esprit de corps}}<nowiki>''</nowiki></code> }}
*Wrong: {{!bxt| <code><nowiki>''</nowiki>{{tlnull|term|1{{=}}esprit de corps}}<nowiki>''</nowiki></code> }}


Line 52: Line 52:
<blockquote>{{tlnull|term|1{{=}}shortstop&nbsp;|content{{=}}shortstop{{bxt|1={{tlnull|anchors|shortstops|short-stop|short stop|sslink}}}}}}</blockquote>
<blockquote>{{tlnull|term|1{{=}}shortstop&nbsp;|content{{=}}shortstop{{bxt|1={{tlnull|anchors|shortstops|short-stop|short stop|sslink}}}}}}</blockquote>


As with styled terms, the second parameter must be used to provide the "bare" term. It is not necessary to add the term itself to the {{tlnull|anchors}} template when using {{tlnull|term}}.  By contrast, when using semicolon-delimited terms in unstructured glossaries, the term <em>does</em> need to be added as an anchor explicitly if link anchorage is desired (which is almost always the case):
As with styled terms, the second parameter must be used to provide the "bare" term. It is not necessary to add the term itself to the {{tlnull|anchors}} template when using {{tlnull|term}}.  By contrast, when using semicolon-delimited terms in unstructured glossaries, the term ''does'' need to be added as an anchor explicitly if link anchorage is desired (which is almost always the case):


<blockquote><code><nowiki>;</nowiki>shortstop{{tlnull|anchors|{{bxt|<code>shortstop</code>}}|shortstops|short-stop|short stop|sslink}}</code></blockquote>
<blockquote><code><nowiki>;</nowiki>shortstop{{tlnull|anchors|{{bxt|<code>shortstop</code>}}|shortstops|short-stop|short stop|sslink}}</code></blockquote>
Line 108: Line 108:
{{term|1=esprit de corps |content={{lang-fr|esprit de corps}}}}<br />
{{term|1=esprit de corps |content={{lang-fr|esprit de corps}}}}<br />


;When two or more language variants of a term share the same definition&#58;:
;When two or more language variants of a term share the same definition::


One definition can actually have two or more terms above it as variations or alternatives with the same definition. The most common use case for this is presenting the term in two variants of English. Example:
One definition can actually have two or more terms above it as variations or alternatives with the same definition. The most common use case for this is presenting the term in two variants of English. Example:
14,061

edits