Template:Variants lite
From Captain of Industry Wiki
Revision as of 20:37, 16 November 2022 by NaK (talk | contribs) (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}}}...")
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: •(•)
- 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
- Basic
- {{Variants lite|Pipe|II|III}} → Pipe [II•III]
- {{Variants lite|Boiler|(Coal)|(Gas)|(Electric)}} → Boiler (Coal) [Gas•Electric]
- {{Variants lite|Assembly|(Manual)|(Electric)|(Electric) II}} → Assembly (Manual) [Electric•Electric II]
- {{Variants lite|Captain's Office}} → Captain's Office II
- Advanced
- {{Variants lite|Pipe|II|III|sep=, }} → Pipe [II, III]
- {{Variants lite|Loose Storage|III|IV|skipunmarked=yes}} → Loose Storage III [IV]
- cf. {{Variants lite|Loose Storage|III|IV}} → Loose Storage [III•IV]
- {{Variants lite|irregular=yes|Farm|Farm|Irrigated Farm|Irrigated}} → Farm [Irrigated]
- Error
- {{Variants lite}} → Template Variants: parameter {{{1}}} is not provided.
- {{Variants lite|Ipsum|II|III}} → Ipsum [II•III] (Error is not returned for unexist buildings.)
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.)
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.)