Template:Variants lite/doc
From Captain of Industry Wiki
- 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.)