Template:P2
From TechInfoDepot
Jump to navigationJump to search{{{2}}}
This template is used on many pages, and changes to it will be widely noticed. Please test any changes in the template's /sandbox or /testcases subpages, or in a user subpage, and consider discussing changes at the talk page before implementing them. |
The templates P1 and P2 simply return the first respectively second unnamed input parameter respectively. For example:
- Template:P1 (talk links edit) returns Template:P1
- Template:P2 (talk links edit) returns bar
These templates can be used inside other templates as an alternative to the Template:Pf parser function, to switch between outputs based on whether the input is "1" or "2":
- [[Template:P{{{1}}}]] ([[Template talk:P{{{1}}}|talk]] {1}}}|limit=500}} links {1}}}|action=edit}} edit)
Using {{#switch}}
, this syntax is equivalent to
- [[Template:Template:Hashswitch:{{{1}}}]] ([[Template talk:Template:Hashswitch:{{{1}}}|talk]] Template:Hashswitch:{{{1}}}|limit=500}} links Template:Hashswitch:{{{1}}}|action=edit}} edit)
except that the parser function strips whitespace between parameters whereas the templates don't.
See also
The above documentation is transcluded from Template:P2/doc. (edit | history) Editors can experiment in this template's sandbox (create | mirror) and testcases (create) pages. Please add categories to the /doc subpage. Subpages of this template. |