Template:P2/doc
From TechInfoDepot
Jump to navigationJump to searchThis is a documentation subpage for Template:P2. It may contain usage information, categories and other content that is not part of the original template page. |
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