User:KnightMiner/Sandbox/p/doc - minecraft.fandom.com
Jump to navigation
Jump to search
Treść tej podstrony pochodzi z artykułu „User:KnightMiner/Sandbox/p/doc” w domenie minecraft.fandom.com na licencji CC BY-NC-SA 3.0
[purge]
This is the documentation page. It should be transcluded into the main template page. See Template:Documentation for more informationThis 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[]
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[]
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[]
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[]