Template:TG

From Wikibooks, open books for an open world
Jump to navigation Jump to search
Purpose
This template links to a section title or anchor of the Trainz/Glossary page, which is arranged alphabetically into sub-sections organized by spans of titles beginning with the letter ranges (e.g. Aa—Bz); similar to the headings of references like encyclopedias, phone books or a paper dictionary.

Intro[edit source]

The template is used as a convenient link-creating (term explaining) to keep the page count down. This aids in the composition of concise text without the bother of slowing down to ensure the reader understands the terminology or base meaning of a colloquial or special term.

Any brief-to-describe Trainz Terminology or a few paragraphs (see Camera for an example) can thus be linked without disturbing the main flow of the current page's text, yet provide that term explanation globally within the work (Wikibook).
The similar template {{TN}} links to the special glossary Notations with the exact same syntax described below.

 

Link formation notes[edit source]

  • Some direct to topic or section linking is possible using titles that are present, or where an {{anchor}} template has been installed with that text string. {{Anchor}} creates an invisible section title in a page, which wikimarkup language knows how to dereference. When such a reference is accessed, template will then form a proper link and 'pretty display' to such values when given them as the first placeholder parameter, Arg1 or when dereferenced inside a template, {{{1}}} or {{{1|}}}.
The general format of a template call is (whitespace added for clarity)
{{TG | Arg1 | Arg2 }}, where Arg1 is usually just a letter and Arg2 the term. The term will then be presented as a hyperlink to the section of the Glossary indexed by the letter.

If a term has a direct link created by an anchor above it's text then

{{TG|Arg1}}, will connect to that term, instead of an alphabetized section (because you told it too). If such a link fails, the hyperlink click action formed by the template will put the user into the top of the page.
  • This is to be avoided, so check your link when proofing the page.

 

Usage
  1. NORMAL CASE: Give two arguments to the template as parameters such as
    {{TG|C|cdp file}} or {{TG|c|cdp file}}.
    1. The link will display as cdp file and link to an {{anchor}} 'C' which is a hidden page section title.
    2. For ease of application, the Glossary is sub-divided into sections by ranges of letters as noted above.
    3. The template in this mode will place the reader clicking the link at the body of the section just at the location after the {{anchor}} text position.
    4. If a section gets too long for the reader to navigate easily to a topic lower down, the Glossary may be further sub-divided and the anchors adjusted, including use of multiple letter combinations (CM, CMP, DCC, etc.).
  2. Particularly oft-linked terms can be given a specific anchor as follows:
    1. Alternative case-1: Give two arguments to the template as pass parameters such as
      {{TG|cdp_file|cdp file}} and the template will form the link
      [[Trainz/Glossary#cdp_file|cdp file]] but display as just cdp file.
      1. This works fully only if the section referencing '#cdp_file' is a section title or the hidden section titles defined by including an {{Anchor|cdp file}} in 'Glossary'.
      2. Notice the EXPLICIT use of an underscore to connect two words in the term to eliminate whitespace characters.
        Section linking, including to anchors cannot be made by wikimarkup if the linked section name has whitespaces.
  3. RARER CASE: If a single word without any whitespaces is a section title of the glossary, it may be used by itself.

 

Actual code is
[[Trainz/Glossary#{{{1}}}|{{{2|{{{1}}}}}}]]
Note
In the resulting concatenation shown below, the second {{{1}}} parameter is the default display string.

[[Trainz/Glossary#{{{1}}}|{{{1}}}]]