Jump to content

Teamplaid:Glossary link

O Wiktionary

[[#{{{1}}}|{{{1}}}]]

Template documentation[view] [edit] [history] [purge]

Ùsaid - Usage

[deasaich]

The template {{Glossary link}} and its variant {{Glossary link internal}} are templates for creating structured links to particular entries in topical glossaries (e.g. the {{Cuegloss}} template).

{{Glossary link}} is a meta-template for creating templates for specific major glossary articles; it is not usually used directly in an article. {{Glossary link internal}} is usually used directly in the glossary article itself. Please categorize any derived, topical glossary link templates that use this meta-template into Roinn-seòrsa:Glossary link templates (this is usually done at the bottom of the template's /doc page, so that the category is not inside the template itself and it not accidentally transcluded into the articles that use the template).

The documentation below explains how to use them for your topic's template-structured glossary. Like the {{Dfn}} wrapper, and the glossary {{Term}} template, it uses the <dfn> HTML element properly. (Note that {{glossary link internal}} necessarily does not use it; <dfn> should only be used once per term on a single page, at the defining appearance of it.)

{{Glossary link}} creates a normal blue link. To prevent the "sea of blue" effect, {{Glossary link internal}} uses the light dashed underline style that has become a de facto Web standard for definitional markup.[1]

Tech detail: By using an internal <span>...</span> with its own independent title attribute for a tool tip, it sets this up in a way that does not violate the very geeky and backasswards HTML5 specs on the handing of the title attribute of <dfn>, which is the exact term defined, not its definition.

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 glossary article title (if on another page) and what the entry's name is, as specified by the template, which is where the reader will go if they click on the glossary link. This replaces the default Wikipedia tooltip for such a link, which would only give the article title.

Syntax (basic use cases)

[deasaich]
Linking from regular article prose to glossary entries
  • Use a term as it appears in a separate glossary article: {{Glossary link|Glossary=Glossary of botanical terms|utricle}} – gives: utricle
  • Use an alternative term, linking to the related term in a separate glossary article: {{Glossary link|Glossary=Glossary of botanical terms|utricle|utricular}} – gives: utricular
  • Use a partially piped link: {{glossary link|Glossary=Glossary of botanical terms|utricle}}s – gives: utricles
  • Link targets are converted to lower case by this template and the corresponding {{Term}} in the glossary (the original version as specified in {{Term}}, even if it is "uTriCle", will also work): {{Glossary link|Glossary=Glossary of botanical terms|Utricle}} – gives: Utricle (note the link target). In other words, {{Glossary link|Glossary=Glossary of botanical terms|utricle|Utricle}} is not necessary.
     
  • Use a term as it appears in the glossary section of the same article: {{Glossary link|chicken nugget}} – gives: chicken nugget
  • Same but less visually intrusive: {{Glossary link internal|chicken nugget}} – gives: chicken nugget
  • Use an alternative term, linking to a related term in the glossary section of the same article: {{Glossary link|chicken nugget|Compressed and breaded poultry snacks}} – gives: Compressed and breaded poultry snacks
  • Same but less visually intrusive: {{Glossary link internal|chicken nugget|Compressed and breaded poultry snacks}} – gives: Compressed and breaded poultry snacks

Normally this is done with a derived, glossary-specific template. For example, {{Glossary link|Glossary=Glossary of cue sports terms|massé}} can be done simply with {{Cuegloss|massé}}.

Linking between glossary entries on the same page

We use the {{Glossary link internal}} variant to not plaster the page with blue links; ones that go to full articles on terms will thus stand out from links to other short definitions in the same glossary:

Syntax (geeky version)

[deasaich]
{{Glossary link|Glossary=glossary article|term=term in glossary}}  results in:  [[#{{{1}}}|{{{1}}}]]
{{Glossary link|Glossary=glossary article|term in glossary}}  results in:  Term in glossary
{{Glossary link|Glossary=glossary article|term=term in glossary|text=text in article}}  results in:  [[#{{{1}}}|text in article]]
{{Glossary link|Glossary=glossary article|term in glossary|text in article}}  results in:  text in article
{{Glossary link|term in glossary}}  results in:  text in article
{{Glossary link|term in glossary|text in article}}  results in:  text in article

The {{glossary link internal}} variant works exactly the same, but is used inside the glossary itself to provide cross-references between entries, and is also used when the same term is linked twice in other articles (e.g. because the article is very long). Its only difference from {{glossary link}} is that it does not use <dfn>, since it is only supposed to be used once per page per term, and it does not blue-link the link, since we don't want to create a "sea of blue" link mess.

{{Glossary link internal|term in glossary}}  results in:  text in article
{{Glossary link internal|term in glossary|text in article}}  results in:  text in article


Paramadairean - Parameters

[deasaich]

Each version of the template takes up to three case-sensitive, parameters for its data:

  • |Glossary=the title of the glossary article to be linked to
    • This is part of the URL to be generated; it cannot contain any styling, templates, HTML, or other markup.
  • |Term=the term entry in the glossary to be linked to  (or any {{Anchor}} for it)
    • This is part of the URL to be generated; it cannot contain any styling, templates, HTML, or other markup.
    • A double quote (") character must be escaped as &quot; or the tooltip will break. Glossary-specific templates based on this meta-template need to mention this prominently in their documentation.
    • This parameter can also be done as |1= or the first unnamed parameter. It must not be unnamed when creating a glossary-specific template from the meta-template, because you cannot guarantee that input will not contain a = character.
  • |text=the actual text in the article to be linked from, if different from the term linked to
    • This parameter can be styled, templated, etc. (though cannot contains links – it's going to become the link). Styling can also be applied before and after the entire template, of course.

Limitations: The glossary and term parameters cannot have any HTML or wiki markup; they are basically parts of URLs (namely http://en.wikipedia.org/wiki/glossary#term).

A |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 in a navbox or infobox. The parameter will accept established HTML/CSS color names (e.g. white) and hex values (e.g. #FFFFFF), and is spelled "color" since this is the spelling used by HTML and CSS.

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

  • |id=an_ID – an Anchor ID (no spaces, must begin with alphabetic letter) for #linking and possibly other purposes
  • |style=arbitrary:css; – CSS directives for custom-styling the instance
  • |class=css_class – a CSS class or classes (separated by spaces not commas if more than one); by default it already include glossary-link or glossary-link-internal (in the template with the respectively matching name) for custom user CSS.

Glossary entry formatting

[deasaich]

Eisimpleirean - Examples

[deasaich]

The template {{Cuegloss}} for cue sports:

{{Glossary link
|Glossary=Glossary of cue sports terms
|term={{{1}}}
|text={{{2|}}}
}}

The {{Glossary link internal}} variant is used inside such an article as Glossary of cue sports terms:

{{Glossary link internal
|Glossary=Glossary of cue sports terms
|term={{{1}}}
|text={{{2|}}}
}}

For real-world application, see Teamplaid:Cuegloss/documentation, the Glossary of cue sports terms article, and articles like Nine-ball that use the template to link to terms in the glossary.

Faic cuideachd - Also see

Iomraidhean - References

[deasaich]
  1. This style is exemplified by TechScribe, an online resource for technical writers, and can been seen on most of their pages, e.g. this one, where blue linking, like Wikipedia's, is used for major topics, while faint underlining is used for definitional links to the site's glossary.