Template:Xpdnp/doc: Difference between revisions
(Created page with "{{Documentation subpage}} This {{til|xpdnp}} (expansion demo with named parameters) shows the call of a template or switch and its result, for documentation. I...") |
m (remove { from templates) |
||
Line 23: | Line 23: | ||
While the template works for templates without parameters it does not work properly for variables: | While the template works for templates without parameters it does not work properly for variables: | ||
*<nowiki> | *<nowiki>xpdnp|CURRENTTIME</nowiki> gives: xpdnp|CURRENTTIME | ||
Therefore, for variables use {{tim|xpdoc}} instead: | Therefore, for variables use {{tim|xpdoc}} instead: | ||
*<nowiki> | *<nowiki>xpdoc|CURRENTTIME</nowiki> gives: xpdoc|CURRENTTIME | ||
<!-- template categories and interwiki links --> | <!-- template categories and interwiki links --> | ||
<includeonly></includeonly> | <includeonly></includeonly> |
Revision as of 11:26, 9 January 2019
![]() |
This is a documentation subpage for Template:Xpdnp (see that page for the template itself). It contains usage information, categories and other content that is not part of the original template page. |
This Template:Til (expansion demo with named parameters) shows the call of a template or switch and its result, for documentation. It works with up to 6 named parameters.
Examples[edit source]
Examples, compared with equivalent calls of >Template:xpdoc (backlinks, edit), >Template:xpdopec (backlinks, edit), and >Template:xpdopepec (backlinks, edit):
- {{xpdnp|tc}} gives:
{{tc{{{1n}}}={{{2n}}}={{{3n}}}={{{4n}}}={{{5n}}}=}}{{{6n}}}=
gives in [1]
- {{xpdoc|tc}} gives:
"{{tc}} [[Category:Templates]] [[Category:Templates]] [[Category:Templates]] [[Category:Templates]] [[Category:Templates]] [[Category:Templates]] [[Category:Templates]] [[Category:Templates]] [[Category:Templates]] [[Category:Templates]] [[Category:Templates]] [[Category:Templates]] [[Category:Templates]] [[Category:Templates]] [[Category:Templates]]"}}}}}}}}}}
→ "in" [2]
- {{xpdnp|t np|1n=q|1v=s}} gives:
{{t np{{{2n}}}={{{3n}}}={{{4n}}}={{{5n}}}=}}{{{6n}}}=
gives Template:T np [3]
- {{xpdopec|t np|q|s}} gives: Template:Xpdopec
- {{xpdnp|p|1n=|1v=q}} gives:
{{p{{{2n}}}={{{3n}}}={{{4n}}}={{{5n}}}=}}{{{6n}}}=
gives Template:P [4]
(the empty string is used as parameter name)
- {{xpdopec|p||q}} gives: Template:Xpdopec
- {{xpdnp|t np2|1n=q|1v=u|2n=s|2v=v}} gives:
{{t np2{{{3n}}}={{{4n}}}={{{5n}}}=}}{{{6n}}}=
gives Template:T np2 [5]
- {{xpdopepec|t np2|q|u|s|v}} gives: Template:Xpdopepec
- {{xpdnp|#switch:q|1n=p|1v=u|2n=q|2v=v}} gives:
{{#switch:q{{{3n}}}={{{4n}}}={{{5n}}}=}}{{{6n}}}=
gives v [6]
- {{xpdopepec|#switch:q|p|u|q|v}} gives: Template:Xpdopepec
- {{xpd5opepec||||||#switch:q|p|u|q|v}} gives: Template:Xpd5opepec
While the template works for templates without parameters it does not work properly for variables:
- xpdnp|CURRENTTIME gives: xpdnp|CURRENTTIME
Therefore, for variables use >Template:xpdoc (backlinks, edit) instead:
- xpdoc|CURRENTTIME gives: xpdoc|CURRENTTIME