Template:Glossary link/doc: Difference between revisions

clean up
m (1 revision)
 
(clean up)
 
Line 3: Line 3:


== Usage ==
== Usage ==
The template '''{{tlx|glossary link}}''' and its variant '''{{tlx|glossary link internal}}''' are <em>meta-templates</em> for creating templates that make structured links to particular entries in topical glossaries; they should never be used directly in an article. The documentation below explains how to use them for your topic's [[WP:MOSGLOSS|structured glossary]].  Like {{tlx|dfn}}, it uses the <code><nowiki><dfn></nowiki></code> HTML element properly. Unlike {{tnull|dfn}}, which is just invisible metadata, this template also uses the light dashed underline style that has become a ''de facto'' Web standard for definitional markup. Because it does in fact link to another page as well to provide the definition, it retains the blue link color like any other wikilink.  Due to lack of what would be a pretty sophisticated facility in the [[MediaWiki]] parser, there is no way to have the definition in the glossary be pulled into a pop-up tooltip on mouseover, which would be really cool. Maybe someday. For now it shows the article title and entry name.
The template '''{{tlx|glossary link}}''' and its variant '''{{tlx|glossary link internal}}''' are ''meta-templates'' for creating templates that make structured links to particular entries in topical glossaries; they should never be used directly in an article. The documentation below explains how to use them for your topic's [[SV:MOSGLOSS|structured glossary]].  Like {{tlx|dfn}}, it uses the <code><nowiki><dfn></nowiki></code> HTML element properly. Unlike {{tnull|dfn}}, which is just invisible metadata, this template also uses the light dashed underline style that has become a ''de facto'' Web standard for definitional markup. Because it does in fact link to another page as well to provide the definition, it retains the blue link color like any other wikilink.  Due to lack of what would be a pretty sophisticated facility in the [[MediaWiki]] parser, there is no way to have the definition in the glossary be pulled into a pop-up tooltip on mouseover, which would be really cool. Maybe someday. For now it shows the article title and entry name.


(Tech detail: By using an internal {{tag|span}} with its own independent <code>title</code> attribute for tool tip fun, it sets this up in a way that does not violate the very geeky and backasswards HTML5 specs on the handing of the <code>title</code> attribute of {{tag|dfn|o}}, which is the exact term defined, not its definition).
(Tech detail: By using an internal {{tag|span}} with its own independent <code>title</code> attribute for tool tip fun, it sets this up in a way that does not violate the very geeky and backasswards HTML5 specs on the handing of the <code>title</code> attribute of {{tag|dfn|o}}, which is the exact term defined, not its definition).
Line 21: Line 21:
*{{para|glossary|<var>the name of the glossary article to be linked to</var>}}
*{{para|glossary|<var>the name of the glossary article to be linked to</var>}}
*{{para|term|<var>the term entry in the glossary to be linked to</var>}} &nbsp;(or any {{tlx|anchor}} for it); {{strong|a double quote (") character {{em|must}} be escaped as <code>&amp;quot;</code> or the second half (term) of tooltip will not show up.}} Templates based on this one need to mention this prominently in their documentation.
*{{para|term|<var>the term entry in the glossary to be linked to</var>}} &nbsp;(or any {{tlx|anchor}} for it); {{strong|a double quote (") character {{em|must}} be escaped as <code>&amp;quot;</code> or the second half (term) of tooltip will not show up.}} Templates based on this one need to mention this prominently in their documentation.
*{{para|text|<var>the actual text in the article to be linked <em>from</var>, if different from the term linked <em>to</em></var>}}
*{{para|text|<var>the actual text in the article to be linked ''from</var>, if different from the term linked <em>to''</var>}}


<strong>Limitations</strong>: The <var>glossary</var> and <var>term</var> parameters cannot have any HTML or wiki markup; they are basically parts of URLs (namely <code><nowiki>http://</nowiki>en.wikipedia.org/wiki/<var>glossary</var>#<var>term</var></code>). If styling is needed (e.g. italics for a non-English term or a book title), it must be done around the entire template or inside the <code><var>text</var></code> parameter.
<strong>Limitations</strong>: The <var>glossary</var> and <var>term</var> parameters cannot have any HTML or wiki markup; they are basically parts of URLs (namely <code><nowiki>http://</nowiki>en.Sarkarverse.org/wiki/<var>glossary</var>#<var>term</var></code>). If styling is needed (e.g. italics for a non-English term or a book title), it must be done around the entire template or inside the <code><var>text</var></code> parameter.


A fourth {{para|color}} parameter allows the color of the text to be changed. This should <em>only</em> be done when the rest of the text is also another color for some reason, e.g. because of white text in a dark-background table cell. The parameter will accept established HTML/CSS color names (e.g. <code>white</code>) and hex values (e.g. <code>#FFFFFF</code>), and is spelled "<code>color</code>" since this is the spelling used by HTML and CSS.
A fourth {{para|color}} parameter allows the color of the text to be changed. This should ''only'' be done when the rest of the text is also another color for some reason, e.g. because of white text in a dark-background table cell. The parameter will accept established HTML/CSS color names (e.g. <code>white</code>) and hex values (e.g. <code>#FFFFFF</code>), and is spelled "<code>color</code>" since this is the spelling used by HTML and CSS.


Some little-used parameters that are there just in case:
Some little-used parameters that are there just in case:
14,070

edits