Template
WorldSwitch
From Dogcraft Wiki
No edit summary |
No edit summary Tag: Visual edit |
||
Line 1: | Line 1: | ||
<includeonly>{{#ifeq: {{{mode|}}} | Category | <includeonly>{{#ifeq: {{{mode|}}} | Category | ||
|{{#if: {{{1}}} | {{#switch: {{{1}}} | Survival = [[Survival]] | Survival 1 = [[Survival 1]] | Survival 2 = [[Survival 2]] | Survival 3 = [[Survival 3]] | Survival 4 = {{#switch: {{{2|}}} | Husky = [[Survival 4]] (Husky) | Beagle = [[Survival 4]] (Beagle) | [[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]] | {{{1}}} }}|{{#if: {{{2}}}|[[Survival 4]]|}}}} | |{{#if: {{{1}}} | {{#switch: {{{1}}} | Survival = [[Survival]] | Survival 1 = [[Survival 1]] | Survival 2 = [[Survival 2]] | Survival 3 = [[Survival 3]] | Survival 4 = {{#switch: {{{2|}}} | Husky = [[Survival 4]] (Husky) | Beagle = [[Survival 4]] (Beagle) | [[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]] | {{{1}}} }}|{{#if: {{{2}}}|[[Survival 4]]|}}}} | ||
|{{#if: {{{1}}} | {{#switch: {{{1}}} | Survival = [[Survival]] | Survival 1 = [[Survival 1]] | Survival 2 = [[Survival 2]] | Survival 3 = [[Survival 3]] | Survival 4 = {{#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> | |{{#if: {{{1}}} | {{#switch: {{{1}}} | Survival = [[Survival]] | Survival 1 = [[Survival 1]] | Survival 2 = [[Survival 2]] | Survival 3 = [[Survival 3]] | Survival 4 = {{#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== | ||
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. | 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=== | ===Example=== | ||
<nowiki>{{WorldSwitch|Survival}}</nowiki> generates: {{WorldSwitch|Survival}} | <code><nowiki>{{WorldSwitch|Survival}}</nowiki></code> generates: {{WorldSwitch|Survival}} | ||
<nowiki>{{WorldSwitch|Survival 4}}</nowiki> generates: {{WorldSwitch|Survival 4}} | <code><nowiki>{{WorldSwitch|Survival 4}}</nowiki></code> generates: {{WorldSwitch|Survival 4}} | ||
<nowiki>{{WorldSwitch|Survival 4|Husky}}</nowiki> generates: {{WorldSwitch|Survival 4|Husky}} | <code><nowiki>{{WorldSwitch|Survival 4|Husky}}</nowiki></code> generates: {{WorldSwitch|Survival 4|Husky}} | ||
<nowiki>{{WorldSwitch|Survival 4 (Husky)}}</nowiki> generates: {{WorldSwitch|Survival 4 (Husky)}} | <code><nowiki>{{WorldSwitch|Survival 4 (Husky)}}</nowiki></code> generates: {{WorldSwitch|Survival 4 (Husky)}} | ||
<nowiki>{{WorldSwitch|Husky}}</nowiki> generates: {{WorldSwitch|Husky}} | <code><nowiki>{{WorldSwitch|Husky}}</nowiki></code> generates: {{WorldSwitch|Husky}} | ||
<nowiki>{{WorldSwitch||Husky}}</nowiki> generates: {{WorldSwitch||Husky}} | <code><nowiki>{{WorldSwitch||Husky}}</nowiki></code> generates: {{WorldSwitch||Husky}} | ||
<nowiki>{{WorldSwitch|Husky|mode=Category}}</nowiki> generates: {{WorldSwitch|Husky|mode=Category}} | <code><nowiki>{{WorldSwitch|Husky|mode=Category}}</nowiki></code> generates: {{WorldSwitch|Husky|mode=Category}} | ||
<nowiki>{{WorldSwitch||Husky|mode=Category}}</nowiki> generates: {{WorldSwitch||Husky|mode=Category}} | <code><nowiki>{{WorldSwitch||Husky|mode=Category}}</nowiki></code> generates: {{WorldSwitch||Husky|mode=Category}} | ||
<nowiki>{{WorldSwitch|Survival 4 (Husky)|mode=Category}}</nowiki> generates: {{WorldSwitch|Survival 4 (Husky)|mode=Category}} | <code><nowiki>{{WorldSwitch|Survival 4 (Husky)|mode=Category}}</nowiki></code> generates: {{WorldSwitch|Survival 4 (Husky)|mode=Category}} |
Revision as of 23:40, 4 July 2021
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
{{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