Difference between revisions of "Template:Variants manual"

From Captain of Industry Wiki
Jump to: navigation, search
(Created page with "<includeonly><!-- -->{{#if:{{{1|}}} |<!-- -->{{#ifexist: {{{1}}} |<!-- -->[[{{{1}}}]]<!-- -->{{#if:{{{2|}}} |<!-- --> [<!-- -->[[{{{1}}} {{#ifexist: {{{1}}} ({{{2}}})|({{{2}}}) |{{{2}}} }} |{{{2}}}]]<!-- -->{{#if: {{{3|}}} |•[[{{{1}}} {{#ifexist: {{{1}}} ({{{3}}})|({{{3}}})|{{{3}}} }}|{{#replace:{{#replace:{{{3}}}|(}}|)}}]]}}<!-- -->{{#if: {{{4|}}} |•{{{1}}} {{#ifexist: {{{1}}} ({{{4}}})|({{{4}}})|{{{4}}} }}|{{#re...")
 
m (Added some comments)
 
(6 intermediate revisions by the same user not shown)
Line 1: Line 1:
<includeonly><!--
<includeonly><!--
-->{{#if:{{{1|}}} |<!--
-->{{#if:{{{1|}}} |<!--
   -->{{#ifexist: {{{1}}} |<!--
 
     -->[[{{{1}}}]]<!--
  ** In case of 'irregular = yes' **
     -->{{#if:{{{2|}}} |<!--
 
   -->{{#ifeq: {{{irregular|no}}} | yes |<!--
     -->[[{{{1}}}|{{#if:{{{2|}}}|{{{2}}}|{{{1}}}}}]]<!--
     -->{{#if:{{{3|}}} |<!--
       -->&nbsp;&lbrack;<!--
       -->&nbsp;&lbrack;<!--
       -->[[{{{1}}} {{#ifexist: {{{1}}} ({{{2}}})|({{{2}}}) |{{{2}}} }} |{{{2}}}]]<!--
       -->[[{{{3}}}|{{#if:{{{4|}}}|{{{4}}}|{{{3}}}}}]]<!--
       -->{{#if: {{{3|}}} |&bull;[[{{{1}}} {{#ifexist: {{{1}}} ({{{3}}})|({{{3}}})|{{{3}}} }}|{{#replace:{{#replace:{{{3}}}|(}}|)}}]]}}<!--
       -->{{#if: {{{5|}}} |{{{sep|&bull;}}}[[{{{5}}}|{{#if:{{{6|}}}|{{{6}}}|{{{5}}}}}]]}}<!--
       -->{{#if: {{{4|}}} |&bull;[[{{{1}}} {{#ifexist: {{{1}}} ({{{4}}})|({{{4}}})|{{{4}}} }}|{{#replace:{{#replace:{{{4}}}|(}}|)}}]]}}<!--
       -->{{#if: {{{7|}}} |{{{sep|&bull;}}}[[{{{7}}}|{{#if:{{{8|}}}|{{{8}}}|{{{7}}}}}]]}}<!--
       -->{{#if: {{{5|}}} |&bull;[[{{{1}}} {{#ifexist: {{{1}}} ({{{5}}})|({{{5}}})|{{{5}}} }}|{{#replace:{{#replace:{{{5}}}|(}}|)}}]]}}<!--
       -->{{#if: {{{9|}}} |{{{sep|&bull;}}}[[{{{9}}}|{{#if:{{{10|}}}|{{{10}}}|{{{9}}}}}]]}}<!--
       -->{{#if: {{{6|}}} |&bull;[[{{{1}}} {{#ifexist: {{{1}}} ({{{6}}})|({{{6}}})|{{{6}}} }}|{{#replace:{{#replace:{{{6}}}|(}}|)}}]]}}<!--
       -->{{#if: {{{11|}}} |{{{sep|&bull;}}}[[{{{11}}}|{{#if:{{{12|}}}|{{{12}}}|{{{11}}}}}]]}}<!--
       -->{{#if: {{{7|}}} |&bull;[[{{{1}}} {{#ifexist: {{{1}}} ({{{7}}})|({{{7}}})|{{{7}}} }}|{{#replace:{{#replace:{{{7}}}|(}}|)}}]]}}<!--
       -->{{#if: {{{13|}}} |{{{sep|&bull;}}}[[{{{13}}}|{{#if:{{{14|}}}|{{{14}}}|{{{13}}}}}]]}}<!--
       -->{{#if: {{{8|}}} |&bull;[[{{{1}}} {{#ifexist: {{{1}}} ({{{8}}})|({{{8}}})|{{{8}}} }}|{{#replace:{{#replace:{{{8}}}|(}}|)}}]]}}<!--
       -->{{#if: {{{15|}}} |{{{sep|&bull;}}}[[{{{15}}}|{{#if:{{{16|}}}|{{{16}}}|{{{15}}}}}]]}}<!--
       -->&rbrack;<!--
       -->&rbrack;<!--
     -->}}<!--
     -->}}<!--
     -->| {{#if: {{#ifexist: {{{1}}} {{{2}}}|yes}}{{#ifexist: {{{1}}} ({{{2}}})|yes}} |<!--
     -->|<!--
       -->[[{{{1}}} {{#ifexist: {{{1}}} ({{{2}}})|({{{2}}})|{{{2}}} }}]]<!--
   
       -->{{#if:{{{3|}}} |<!--
    ** In case of standard buildings such as "Loose Storage [II, III, IV]" **
   
    -->{{#ifexpr: {{#ifexist:{{{1}}}|1|0}} and {{#ifeq:{{{skipunmarked|no}}}|yes|0|1}} |<!--
       -->[[{{{1}}}]]<!--
       -->{{#if:{{{2|}}} |<!--
         -->&nbsp;&lbrack;<!--
         -->&nbsp;&lbrack;<!--
         -->[[{{{1}}} {{#ifexist: {{{1}}} ({{{3}}})|({{{3}}})|{{{3}}} }}|{{#replace:{{#replace:{{{3}}}|(}}|)}}]]<!--
         -->[[{{{1}}} {{#ifexist: {{{1}}} ({{{2}}})|({{{2}}}) |{{{2}}} }} |{{{2}}}]]<!--
         -->{{#if: {{{4|}}} |&bull;[[{{{1}}} {{#ifexist: {{{1}}} ({{{4}}})|({{{4}}})|{{{4}}} }}|{{#replace:{{#replace:{{{4}}}|(}}|)}}]]}}<!--
        -->{{#if: {{{3|}}} |{{{sep|&bull;}}}[[{{{1}}} {{#ifexist: {{{1}}} ({{{3}}})|({{{3}}})|{{{3}}} }}|{{#replace:{{#replace:{{{3}}}|(}}|)}}]]}}<!--
         -->{{#if: {{{5|}}} |&bull;[[{{{1}}} {{#ifexist: {{{1}}} ({{{5}}})|({{{5}}})|{{{5}}} }}|{{#replace:{{#replace:{{{5}}}|(}}|)}}]]}}<!--
         -->{{#if: {{{4|}}} |{{{sep|&bull;}}}[[{{{1}}} {{#ifexist: {{{1}}} ({{{4}}})|({{{4}}})|{{{4}}} }}|{{#replace:{{#replace:{{{4}}}|(}}|)}}]]}}<!--
         -->{{#if: {{{6|}}} |&bull;[[{{{1}}} {{#ifexist: {{{1}}} ({{{6}}})|({{{6}}})|{{{6}}} }}|{{#replace:{{#replace:{{{6}}}|(}}|)}}]]}}<!--
         -->{{#if: {{{5|}}} |{{{sep|&bull;}}}[[{{{1}}} {{#ifexist: {{{1}}} ({{{5}}})|({{{5}}})|{{{5}}} }}|{{#replace:{{#replace:{{{5}}}|(}}|)}}]]}}<!--
         -->{{#if: {{{7|}}} |&bull;[[{{{1}}} {{#ifexist: {{{1}}} ({{{7}}})|({{{7}}})|{{{7}}} }}|{{#replace:{{#replace:{{{7}}}|(}}|)}}]]}}<!--
         -->{{#if: {{{6|}}} |{{{sep|&bull;}}}[[{{{1}}} {{#ifexist: {{{1}}} ({{{6}}})|({{{6}}})|{{{6}}} }}|{{#replace:{{#replace:{{{6}}}|(}}|)}}]]}}<!--
         -->{{#if: {{{8|}}} |&bull;[[{{{1}}} {{#ifexist: {{{1}}} ({{{8}}})|({{{8}}})|{{{8}}} }}|{{#replace:{{#replace:{{{8}}}|(}}|)}}]]}}<!--
         -->{{#if: {{{7|}}} |{{{sep|&bull;}}}[[{{{1}}} {{#ifexist: {{{1}}} ({{{7}}})|({{{7}}})|{{{7}}} }}|{{#replace:{{#replace:{{{7}}}|(}}|)}}]]}}<!--
         -->{{#if: {{{8|}}} |{{{sep|&bull;}}}[[{{{1}}} {{#ifexist: {{{1}}} ({{{8}}})|({{{8}}})|{{{8}}} }}|{{#replace:{{#replace:{{{8}}}|(}}|)}}]]}}<!--
         -->&rbrack;<!--
         -->&rbrack;<!--
         -->|<span style="color: red;">Template Variant: "{{{1}}}", "{{{1}}} {{{2}}}" or "{{{1}}} ({{{2}}})" is not found.</span><!--
      -->}}<!--
     
      ** In case of semi-standard buildings such as "Boiler (Coal) [Gas, Electric]"
     
      -->| {{#if: {{#ifexist: {{{1}}} {{{2}}}|yes}}{{#ifexist: {{{1}}} ({{{2}}})|yes}} |<!--
        -->[[{{{1}}} {{#ifexist: {{{1}}} ({{{2}}})|({{{2}}})|{{{2}}} }}]]<!--
        -->{{#if:{{{3|}}} |<!--
          -->&nbsp;&lbrack;<!--
          -->[[{{{1}}} {{#ifexist: {{{1}}} ({{{3}}})|({{{3}}})|{{{3}}} }}|{{#replace:{{#replace:{{{3}}}|(}}|)}}]]<!--
          -->{{#if: {{{4|}}} |{{{sep|&bull;}}}[[{{{1}}} {{#ifexist: {{{1}}} ({{{4}}})|({{{4}}})|{{{4}}} }}|{{#replace:{{#replace:{{{4}}}|(}}|)}}]]}}<!--
          -->{{#if: {{{5|}}} |{{{sep|&bull;}}}[[{{{1}}} {{#ifexist: {{{1}}} ({{{5}}})|({{{5}}})|{{{5}}} }}|{{#replace:{{#replace:{{{5}}}|(}}|)}}]]}}<!--
          -->{{#if: {{{6|}}} |{{{sep|&bull;}}}[[{{{1}}} {{#ifexist: {{{1}}} ({{{6}}})|({{{6}}})|{{{6}}} }}|{{#replace:{{#replace:{{{6}}}|(}}|)}}]]}}<!--
          -->{{#if: {{{7|}}} |{{{sep|&bull;}}}[[{{{1}}} {{#ifexist: {{{1}}} ({{{7}}})|({{{7}}})|{{{7}}} }}|{{#replace:{{#replace:{{{7}}}|(}}|)}}]]}}<!--
          -->{{#if: {{{8|}}} |{{{sep|&bull;}}}[[{{{1}}} {{#ifexist: {{{1}}} ({{{8}}})|({{{8}}})|{{{8}}} }}|{{#replace:{{#replace:{{{8}}}|(}}|)}}]]}}<!--
          -->&rbrack;<!--
        -->}}<!--
       
        ** Returns error when page of the building is not found **
       
         -->|<span style="color: red;">Template Variants: the page of "{{{1}}}", "{{{1}}} {{{2}}}" or "{{{1}}} ({{{2}}})" is not found in the wiki.</span><!--
       -->}}<!--
       -->}}<!--
     -->}}<!--
     -->}}<!--
   -->}}<!--
   -->}}<!--
   -->|<span style="color: red;">Template Variant: parameter {{{1}}} is not provided.</span><!--
 
-->}}<!--
  ** Returns error when parameter {{{1}}} is lacked.
--></includeonly><noinclude>{{documentation}}</noinclude>
 
   -->|<span style="color: red;">Template Variants: parameter <nowiki>{{{1}}}</nowiki> is not provided.</span><!--
-->}}</includeonly><noinclude>{{documentation}}</noinclude>

Latest revision as of 20:23, 16 November 2022

Template documentation (for the above template, sometimes hidden or invisible) [view] [edit] [history] [refresh]
Purpose
This template is designed as a subroutine of Template: Variants. This template works stand-alone, but this is unrecommended.
Usage
This template accepts the following parameters:
{{{1}}}: Common part of the machine name for all tiers, such as "Pipe" and "Boiler."
{{{2}}} - {{{8}}}: Remaining part of the machine's name, such as "II" and "Gas."
{{{sep}}} (optional, rare): Specify separator. Default: &bull;(•)
{{{skipunmarked}}} (optional, rare): If yes, the building whose name is an exact match as {{{1}}} (mostly tier 1) will not be listed. See also an example.
This template requires the page of 1st tier of the machine in the wiki. Notably, all parameters are case-sensitive.
The parameters work as the following instead of above when irregular = yes is specified.
{{{1}}}: The page name of 1st tire machine.
{{{2}}}: The name of 1st tire machine. Default value: {{{1}}}
{{{3}}}, {{{5}}}, {{{7}}}, ..., {{{15}}}: The page name of 2nd - 8th tire machine.
{{{4}}}, {{{6}}}, {{{8}}}, ..., {{{16}}}: The abbreviated name of 2nd - 8th tire machine. They ares shown in square brackets.
Example
Details
Bracket Completion
The round brackets may be omitted if the entire parameter is covered by the brackets. For example, you can input "Gas" instead of "(Gas)." However, the brackets cannot be omitted if the parameter is covered partially such as "(Electric) II."
Name of 1st tier machine
This template searches the machine page in the wiki for choosing a format. If there is a page named {{{1}}}, it is considered as 1st tier of the machine. If there is a page named "{{{1}}} {{{2}}}" or "{{{1}}} ({{{2}}})", this name is considered as 1st tier of the machine.
The above text is transcluded from Template:Variants manual/doc; you can change it or view its history. (How does this work?)
If you're done making changes, please refresh the text. (Why?)
You can experiment in this template's sandbox (edit | diff) and testcases (create) pages.
Please add categories and interwikis to Template:Variants manual/doc. (View all subpages of this page.)