Template

WorldSwitch

From Dogcraft Wiki

No edit summary
m (Added mode MultiCategory)
 
(7 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<includeonly>{{#switch: {{{mode|}}}  
<includeonly>{{#switch: {{{mode|}}}  
| Category = {{#if: {{{2|}}}  
| Category = {{#if: {{WorldSwitch/World|{{{1|}}}|{{{2|}}}}} | {{WorldSwitch/World|{{{1|}}}|{{{2|}}}}} | {{#invoke:WorldSwitch|parentWorld|{{{1|}}}|{{{2|}}}}} }}
  |Survival 4
| Subworld = {{WorldSwitch/Subworld|{{{1|}}}|{{{2|}}}}}
  |{{#switch: {{{1}}}  
| World = {{WorldSwitch/World|{{{1|}}}|{{{2}}}}}
      | Survival = Survival
| MultiCategory = {{WorldSwitch/MultiCat|{{{1|}}}|{{{2}}}}}
      | Survival 1 = Survival 1
      | Survival 2 = Survival 2
      | Survival 3 = Survival 3
      | Survival 4 = Survival 4
      | Survival 4 (Husky) = Survival 4
      | Survival 4 (Beagle) = Survival 4
      | [[Survival 4]] = Survival 4
      | [[Survival 4]] (Husky) = Survival 4
      | [[Survival 4]] (Beagle) = Survival 4
      | Husky = Survival 4
      | Beagle = Survival 4
      | Amplified = Amplified
      | Skyblock = Skyblock
      | Creative = Creative
      | MCMMO = MCMMO
      |}}
}}
| Subworld = {{#if: {{{2|}}}  
  | {{{2}}}  
  | {{#if: {{{1|}}}  
      |{{#switch: {{{1|}}}  
          | Survival 4 (Husky) = Husky
          | Survival 4 (Beagle) = Beagle
          | Husky = Husky
          | Beagle = Beagle
          | [[Survival 4]] (Husky) = Husky
          | [[Survival 4]] (Beagle) = Beagle
      |}}
  |}}
}}
| Network = {{#switch: {{{1}}}  
| Network = {{#switch: {{{1}}}  
   | Survival 4 = [[Survival Railway Network (Survival 4)|Survival 4 {{{2|}}} Railway Network]]
   | Survival 4 = [[Survival Railway Network (Survival 4)|Survival 4 {{{2|}}} Railway Network]]
Line 45: Line 15:
   |[[Survival Railway Network ({{{1}}})]]
   |[[Survival Railway Network ({{{1}}})]]
  }}
  }}
|{{#if: {{{1}}}  
|[[{{ucfirst: {{#if: {{WorldSwitch/World|{{{1|}}}|{{{2|}}}}} | {{WorldSwitch/World|{{{1|}}}|{{{2|}}}}} | {{#invoke:WorldSwitch|parentWorld|{{{1|}}}|{{{2|}}}}} }} }}]]{{#if:
  |{{#switch: {{{1}}}  
{{WorldSwitch/Subworld|{{{1|}}}|{{{2|}}}}} | &nbsp;({{ucfirst: {{WorldSwitch/Subworld|{{{1|}}}|{{{2|}}}}} }})}}
      | Survival = [[Survival]]
}}</includeonly><noinclude>[[Category:Tool templates]]
      | Survival 1 = [[Survival 1]]
      | Survival 2 = [[Survival 2]]
      | Survival 3 = [[Survival 3]]
      | Survival 4 = {{#if: {{{2|}}}
        |{{#switch: {{{2|}}}  
            | Husky = [[Survival 4]] (Husky)
            | Beagle = [[Survival 4]] (Beagle)
            | [[Survival 4]]
          }}
        |}}  
      | Survival 4 (Husky) = [[Survival 4]] (Husky)
      | Survival 4 (Beagle) = [[Survival 4]] (Beagle)
      | Husky = [[Survival 4]] (Husky)
      | Beagle = [[Survival 4]] (Beagle)
      | Amplified = [[Amplified]]
      | Skyblock = [[Skyblock]]
      | Creative = [[Creative]]
      | MCMMO = [[MCMMO]]
      | {{{1}}}  
    }}
  |{{#if: {{{2|}}}
      |{{#switch: {{{2|}}}  
        | Husky = [[Survival 4]] (Husky)
        | Beagle = [[Survival 4]] (Beagle)
        | [[Survival 4]]
      }}
  |}}
}}
}}</includeonly><noinclude>


==WorldSwitch template==
==WorldSwitch template==

Latest revision as of 16:03, 29 July 2024


WorldSwitch template

This is a technical template meant to be used inside other template, mainly infoboxes. It converts server world names to include links. It handles most common ways of refering to past and present worlds.

Example

{{WorldSwitch|Survival}} generates: Survival 1

{{WorldSwitch|Survival 4}} generates: Survival 4

{{WorldSwitch|Survival 4|Husky}} generates: Survival 4 (Husky)

{{WorldSwitch|Survival 4 (Husky)}} generates: Survival 4 (Husky)

{{WorldSwitch|Husky}} generates: Survival 4 (Husky)

{{WorldSwitch||Husky}} generates: Survival 4 (Husky)

{{WorldSwitch|Husky|mode=Category}} generates: survival 4

{{WorldSwitch||Husky|mode=Category}} generates: survival 4

{{WorldSwitch|Survival 4 (Husky)|mode=Category}} generates: Survival 4

{{WorldSwitch|Survival 4 (Husky)|mode=Subworld}} generates: Husky


Template data

This is a technical template. If you see this text outside the Template:WorldSwitch page, you are doing something wrong. It is meant to convert most ways to input the 'world' property of infobox templates into what the template is expecting and/or the same thing but with a link to the actual world page referred to.

Template parameters

This template prefers inline formatting of parameters.

ParameterDescriptionTypeStatus
World1

Input for the worlds, this is what actually matters the most. Takes inputs in most ways you could think to input the world that is not actually what the template wants. Except typos. This is to deal with alternative ways to say the same things, not the lack of autocorrect.

Stringrequired
Subworld2

Subworld for use in Survival 4 cases

Example
"Husky" or "Beagle"
Stringsuggested
Modemode

Options are "Category" for world categoires, "Network" for use in the Network line of the Station infobox, and a currently unused "Subworld" option.

Stringoptional