As part of the Unified Community Platform project, your wiki will be migrated to the new platform in the next few weeks. Read more here.

User:KnightMiner/Sandbox/p

From Minecraft Wiki
Jump to: navigation, search
[view | edit | history | purge]Documentation
This is a user namespace meta template
This template should not be used in templates. If the use of this template is needed, leave a message on the talk page so it can be moved to the template namespace.

This template is used to preserve whitespace when using #if:, #switch:, or any alike functions.

Parameters[edit]

The parameter {{{p}}} can be set to choose which parameter to output. If there is no parameter with the name specified, it will return a blank string.

Preserve whitespace[edit]

The primary purpose is in combination with a parser such as #switch:.

"{{#switch:two|one= 1st |two= 2nd |three= 3rd |four= 4th }}"
Produces

"2nd"

While
"{{User:KnightMiner/Sandbox/p|p={{#switch:two|one=1|two=2|three=3|four=4}}| 1st | 2nd | 3rd | 4th }}"
Produces

" 2nd "

Switch[edit]

This template can also be used as a switch, although it will then trim whitespace in most cases.

"{{User:KnightMiner/Sandbox/p|p=two|one= 1st |two= 2nd |three= 3rd |four= 4th }}"
Produces

"2nd"

It can also be stacked, allowing it to preserve whitespace and be it's own switch.

"{{User:KnightMiner/Sandbox/p|p={{User:KnightMiner/Sandbox/p|p=two|one=1|two=2|three=3|four=4}}| 1st | 2nd | 3rd | 4th }}"
Produces

" 2nd "

See also[edit]

[view | edit | history | purge]The above documentation is transcluded from User:KnightMiner/Sandbox/p/doc.