Difference between revisions of "Template:Variants lite"

From Captain of Industry Wiki
Jump to: navigation, search
(Created page with "<includeonly><!-- -->{{#if:{{{1|}}} |<!-- ** In case of 'irregular = yes' ** -->{{#ifeq: {{{irregular|no}}} | yes |<!-- -->[[{{{1}}}|{{#if:{{{2|}}}|{{{2}}}|{{{1}}}}}]]<!-- -->{{#if:{{{3|}}} |<!-- --> [<!-- -->[[{{{3}}}|{{#if:{{{4|}}}|{{{4}}}|{{{3}}}}}]]<!-- -->{{#if: {{{5|}}} |{{{sep|•}}}[[{{{5}}}|{{#if:{{{6|}}}|{{{6}}}|{{{5}}}}}]]}}<!-- -->{{#if: {{{7|}}} |{{{sep|•}}}{{{7}}}|{{#if:{{{8|}}}|{{{8}}}|{{{7}}}...")
 
m (Fixed a bug where wrong brackets may be shown in some case)
 
Line 40: Line 40:
       -->{{#if:{{{2|}}} |<!--
       -->{{#if:{{{2|}}} |<!--
         -->&nbsp;&lbrack;<!--
         -->&nbsp;&lbrack;<!--
         -->[[{{{1}}} {{{2}}} |{{{2}}}]]<!--
         -->[[{{{1}}} {{{2}}}|{{#replace:{{#replace:{{{2}}}|(}}|)}}]]<!--
         -->{{#if: {{{3|}}} |{{{sep|&bull;}}}[[{{{1}}} {{{3}}}|{{#replace:{{#replace:{{{3}}}|(}}|)}}]]}}<!--
         -->{{#if: {{{3|}}} |{{{sep|&bull;}}}[[{{{1}}} {{{3}}}|{{#replace:{{#replace:{{{3}}}|(}}|)}}]]}}<!--
         -->{{#if: {{{4|}}} |{{{sep|&bull;}}}[[{{{1}}} {{{4}}}|{{#replace:{{#replace:{{{4}}}|(}}|)}}]]}}<!--
         -->{{#if: {{{4|}}} |{{{sep|&bull;}}}[[{{{1}}} {{{4}}}|{{#replace:{{#replace:{{{4}}}|(}}|)}}]]}}<!--

Latest revision as of 22:00, 16 November 2022

Template documentation (for the above template, sometimes hidden or invisible) [view] [edit] [history] [refresh]
Purpose
Template:Variants manual uses many "#ifexist", that is expensive function and the number of calls on 1 page is limited to 100 times. Template:Variants lite avoids using "#ifexist," so this template is not limited in the number of calls. Unlike Template:Variants manual, Template:Variants lite does not perform either bracket completion or limited validation of building names.
This template is designed as a subroutine of Template: Variants. Though 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)." Notably, brackets cannot be omitted.
{{{skipunmarked}}} (optional): You shall specify "skipunmarked = yes" if the building whose name is an exact match as {{{1}}} does not exist like a Boiler. Also, you can use this option when you do not want to list building with tier 1. See also an example.
{{{sep}}} (optional, rare): Specify separator. Default: &bull;(•)
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
The above text is transcluded from Template:Variants lite/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 lite/doc. (View all subpages of this page.)