Difference between revisions of "Template:Glossary"
m (updated docs) |
m (added cargo store and declare) |
||
Line 105: | Line 105: | ||
</table> | </table> | ||
− | {{#if: {{{taxonomy|}}} | {{Categorybox|{{{taxonomy|}}}||subcategoriesonly}} {{#ifeq:{{ROOTPAGENAME}}|Glossary||[[Category:{{{taxonomy|}}}]]}} }} | + | {{#if: {{{taxonomy|}}} | {{Categorybox|{{{taxonomy|}}}||subcategoriesonly}} {{#ifeq:{{ROOTPAGENAME}}|Glossary||[[Category:{{{taxonomy|}}}]]{{#cargo_store: |
+ | _table=Taxonomy | ||
+ | |Category={{{taxonomy|}}} | ||
+ | |Glossary={{PAGENAME}} | ||
+ | }} }} }} | ||
}}<!-- end of box display mode | }}<!-- end of box display mode | ||
Line 117: | Line 121: | ||
− | --></includeonly><noinclude>{{Documentation}}</noinclude> | + | --></includeonly><noinclude>{{#cargo_declare: |
+ | _table=Taxonomy | ||
+ | |Category=String | ||
+ | |Glossary=String | ||
+ | }}{{Documentation}}</noinclude> |
Revision as of 19:59, 1 November 2021
This template defines the table "Taxonomy". View table.
Description
{{Glossary}} is a multi-purpose template used beneath glossary pages to power easily accessible display modes through a simple interface as well as manage populated data in the same way across multiple usages.
Overview
- {{Glossary}} (this template) provides and supports a few standardized parameters for glossary pages to populate data through a standardized interface, as well as defines a few different display modes to display said data in an appropriate format.
- Glossary:TERM page transcludes and populates the {{Glossary}} template with appropriate data.
- Along with this they also use
|display = {{{1|abbr}}}
to set the display parameter to the first parameter used when transcluding the glossary page itself, or default toabbr
if unset. - This allows for efficient transclusion of the relevant data through the glossary page itself. For example {{Glossary:Ultra-widescreen}} can be used to retrieve the default abbreviation link (ultra-widescreen), or {{Glossary:Ultra-widescreen|definition}} can be used to retrieve the definition (Ultra-widescreen is a term that refers to widescreen resolutions with an aspect ratio roughly wider than 2:1, and often marketed as "21:9".)
- Along with this they also use
- Editors then use {{Glossary:TERM}} or {{Glossary:TERM|display mode}} on other pages to easily transclude the appropriate data as desired.
Glossary page parameters
Multiple parameters are supported, but almost all are optional; their use is determined by the glossary page itself. The only "user-facing" parameter that is exposed to editors through other pages than the glossary pages themselves is the display parameter which determines what display mode is being used.
display
- The requested display mode. This should always be set to|display = {{{1|abbr}}}
on glossary pages. This is to enable handing down the display parameter from the original page (whatever it might be), down through the associated glossary page and to this actual template.name
- The term itself. This is used for titles where appropriate as well as the target page used in abbreviated links and the like.name abbr
- This is an override parameter that takes precedence over thename
parameter when theabbr
display mode is used. This basically allows to circumvent the otherwise enforced lowercase nature of that display mode ({{Glossary:FPS}} would appear as 'fps', but with this new parameter added it appears as 'FPS' instead).link
- The target of the abbr display mode. Helpful if the intention is to link to another page than TERM. Used for taxonomy pages to link to Category:TERM instead.image
- The file name of the image (under the[[File:XXXXX]]
namespace) to use where appropriate.image alt
- The alt title of the image, shown while hovering with the mouse over it or when using a screen reader.article
- The page name of the article associated with the term. This is closely related to theglossary
parameter.category
- The name of the category associated with the term.glossary
- The name of the glossary page that resides beneath the Glossary:XXXXX namespace. This is closely related to thearticle
parameter.list
- The name of the list associated with the term.cargo
- Currently unused. Might be used in the future to document what Cargo table is associated with the term.taxonomy
- The taxonomy related category associated with the term.definition
- A short definition of the term and what it means.examples
- A few examples showcasing how the term relates to games.notes
- More in-depth notes regarding the term.
Supported transclusion parameters
When transcluding a glossary page, only a single parameter is supported -- that being the display mode to use.
- 1= - The display mode to use. See below section for further details. Can either be written as {{Glossary:Ultra-widescreen|1=abbr}} or as {{Glossary:Ultra-widescreen|abbr}}.
- Defaults to using abbr when omitted entirely.
Supported display modes
abbr
(default) - Outputs an abbreviated link in lowercase to the associated page (set through thelink
parameter on the glossary page; defaults toname
if not set).- To circumvent the otherwise enforced lowercase nature of abbr, there are two options available:
- To enforce an override for all links using abbr (basically all links that looks like {{Glossary:FPS}}), add the
name abbr
parameter to the glossary page instead (see e.g. {{Glossary:FPS}} for an example). - For one-time link overrides, use the
uc
parameter (e.g. {{Glossary:Sci-fi|uc}}), which outputs the abbreviated link in non-lowercase (so typically normal case, with the first letter being uppercase).
- To enforce an override for all links using abbr (basically all links that looks like {{Glossary:FPS}}), add the
- To circumvent the otherwise enforced lowercase nature of abbr, there are two options available:
link
- Outputs the associated link itself without any styling applied (set through thelink
parameter on the glossary page).uc
- Outputs the abbreviated link in non-lowercase (so typically normal case, with the first letter being uppercase).image
- Outputs the image associated with the term (set through theimage
parameter on the glossary page).article
- Outputs a link to the article page associated with the term (set through thearticle
parameter on the glossary page).list
- Outputs a link to the list page associated with the term (set through thelist
parameter on the glossary page).cargo
- Outputs a link to the cargo table associated with the term (set through thecargo
parameter on the glossary page).category
- Outputs a link to the category associated with the term (set through thecategory
parameter on the glossary page).taxonomy
- Outputs a link to the taxonomy category associated with the term (set through thetaxonomy
parameter on the glossary page).definition
- Outputs the definition associated with the term (set through thedefinition
parameter on the glossary page).examples
- Outputs the examples associated with the term (set through theexamples
parameter on the glossary page).notes
- Outputs the notes associated with the term (set through thenotes
parameter on the glossary page).box
- Outputs a customized infobox based on data provided to the template through the various other parameters. This is intended for use on the glossary and category pages themselves.
Examples
- See {{Glossary:Ultra-widescreen}} for a basic example that implements {{Glossary}} for regular use.
- For a more advanced example, see how Taxonomy makes use of the {{Taxonomy/table/row}} template to populate multiple table cells with the desired available data from each retrieved glossary type. Instead of retrieving the data through different templates for each type of data that would need to be separately updated it instead makes calls to the same repository of data, that being the glossary page itself.
In-depth example #0
Typing this: | {{Glossary:Ultra-widescreen}} |
Will appear on the page like this: | ultra-widescreen |
In-depth example #1
Typing this: | {{Glossary:Ultra-widescreen|definition}} |
Will appear on the page like this: | Ultra-widescreen is a term that refers to widescreen resolutions with an aspect ratio roughly wider than 2:1, and often marketed as "21:9". |
In-depth example #2
Typing this: | {{Glossary:Ultra-widescreen|image}} |
Will appear on the page like this: | UWcomparison.png |
In-depth example #3
Typing this: | {{Glossary:Ad-supported|examples}} |
Will appear on the page like this: |
|
In-depth example #4
Typing this: | {{Glossary:Ad-supported|category}} |
Will appear on the page like this: | Ad-supported |
In-depth example #5
The box
display mode is the most comprehensive one yet, and used to populate a lot of information about the term through an infobox. This is intended for use on the glossary and category pages themselves.
Typing this: | {{Glossary:Ad-supported|box}} | |||||||||||||||
Will appear on the page like this: |
|