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

Makes a simple linking typing-aid template replicating the most needed case of {{TR}} for Containers — that which auto-provides literal specification of the word string '_container' after a characteristic name keyword creating '{{{1}}}_container' AND which allows building of a section link on the target page.

If there is a single parameter given, TRC will append container to the output string, hence allows links to be displayed with both words, name and container.   NOTE: ON 2015-0125, the normal operation of this template was reversed. It now provides the _container string automatically--the opposite way the template did beforehand.

  • Any broken links will likely be fixed by deleting such a following word.
  • Accordingly, the following usage is suspect, and likely exactly wrong!

This template in the 'default mode' forms an LITERAL internal link to a 'logical' sub-page of the Trainz Wikibook references division Trainz/containers with placeholder pass parameter {{{1}}} giving such links as [[ Trainz/containers/{{{1}}} | {{{p|{{{s|{{{2|{{{1}}}}}}}}}}}} ]] —thus use of the template implicitly assumes the suffix container is appended and is desired to be displayed since all container article titles end with 'container' as the last word...

  • Further, the link will only be made if the sub-page name is explicitly correct and full—meaning most times the parameter must be in fact a phrase which contains the end word 'container' preceded by a space. Contrast this default with the alternative default link and display behavior of {{TR|C|somename}} discussed below.
  • The |s=section parameter may also be defined to form a section title link, in which case, {{{1}}} must needs have an underscore in place of any and all space characters before the end of 'container' to properly form a link: [[ Trainz/containers/{{{1}}}#{{{s}}} | {{{p|{{{s}}}}}} ]] .
  • As is standard with Trainz link templates, defining the named 'Pretty-Print' parameter | p= something displays the link as {{{p}}} will overide any other pass terms.

  • This processing might be considered a work around doing the opposite link formation of {{TR}}'s default behavior which given the characteristic name, will automatically add 'container' and display the compound of such phrase building. Thus TR makes any link with the word 'container' and display only {{{1}}} or {{{2}}} if given as {{TR|C|name|{{{2}}}}}.

  • In contrast, {{TRC|mesh-table}}, will not form a correct link as the string ' container' must at ALL TIMES be manually appended as in {{TRC|mesh-table container}}... which will also form a correct link but display differently; notice the space in the preceding ' container'.

  • It differs from the very similar call {{TR|C|{{{2}}}}} in that while {{TR|C|name}} does append ' container' for forming the link, it does not and cannot also display the word 'container' in the internal hyperlink.

  • To do that, TR must be given a definition for the pipetrick parameter: ( 'p' ), cluttering up the editable text which is already technical enough.

Use this template instead of TR when you DO NOT want the word container to appear inline.
IN ALL Cases, including the below (p=pretty-name) forms a over-riding 'pretty name' for display of the desired link-to-page of the 'Trainz references volume' of the Trainz Wikibook projects.
  • Since neither TR nor TRC's above mentioned mode handle 'input=full titles' cases like 'Mesh-table container'...
  • An alternative calling form of the template operates much like the {{TR}} template with the keywords |C|c|Con|CON|D|d|DIR|dir|DIRECT|direct|Direct= forming legal value links as: [[Trainz/containers/{{{2}}}|{{{2}}}]].
  • This mode converts N3V Wiki container links in [[ ... ]] pairs to Wikibook compatible links, less the deletion of quotations needed for many TrainzOnline container titles.