From Wikibooks, open books for an open world
Jump to: navigation, search



This template is used to link keywords of the TrainzBaseSpec in tutorial pages and examples to the section coverage detailing the tag or container name.

Call {{TBS|'section-title'|{{{2}}}|p2=append|p=link display string}}

|p='display over-ride'
|p2='suffix after link' (literal used in tables as elaborating classifications, e.g. 'string-array'
|2=anything', so if {{{2}}} is true (defined) certain standard p2 messages will auto-display
such as ' (tag)', ' (container)', ' (obsolete tag)', ' (depreciated tag)' and so forth as is exemplified by this code snippet below.
--> {{#if:{{{p2|}}}|  {{{p2}}}|{{#if:{{{2|}}}|  (obsolete tag)}}}}
  • Notice 'p=' has precedence over {{{1}}} so will display as the link instead. (Generally true for Trainz linking templates)
  • Notice 'p2' gates a logical if-then-else asuffixed parenthesized term if defined.
  • Default displayed link type is the TBS tags/containers formal name (which is the page section header titles), but the template converts short common use names like mesh-table or thumbnails into the default mesh-table container and thumbnails container unless 'p' is defined, for it always has the last word on the displayed phrase.
  • Last but far from least, the template used sans arguments {{TBS}} links the TrainzBaseSpec page so can be used inline as a self-linking reference.