https://portlandwiki.org/index.php?title=Template:Xpdnp/doc&feed=atom&action=historyTemplate:Xpdnp/doc - Revision history2024-03-28T19:53:58ZRevision history for this page on the wikiMediaWiki 1.40.1https://portlandwiki.org/index.php?title=Template:Xpdnp/doc&diff=19947&oldid=prevWikiMaster: Create template.2012-03-16T01:50:17Z<p>Create template.</p>
<p><b>New page</b></p><div>{{Documentation subpage}}<br />
This {{til|xpdnp}} ([[help:expansion|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.<br />
<br />
==Examples==<br />
Examples, compared with equivalent calls of {{tim|xpdoc}}, {{tim|xpdopec}}, and {{tim|xpdopepec}}:<br />
<br />
*<nowiki>{{xpdnp|tc}}</nowiki> gives: {{xpdnp|tc}}<br />
*<nowiki>{{xpdoc|tc}}</nowiki> gives: {{xpdoc|tc}}<br />
<br />
*<nowiki>{{xpdnp|t np|1n=q|1v=s}}</nowiki> gives: {{xpdnp|t np|1n=q|1v=s}}<br />
*<nowiki>{{xpdopec|t np|q|s}}</nowiki> gives: {{xpdopec|t np|q|s}}<br />
<br />
*<nowiki>{{xpdnp|p|1n=|1v=q}}</nowiki> gives: {{xpdnp|p|1n=|1v=q}} (the empty string is used as parameter name)<br />
*<nowiki>{{xpdopec|p||q}}</nowiki> gives: {{xpdopec|p||q}}<br />
<br />
*<nowiki>{{xpdnp|t np2|1n=q|1v=u|2n=s|2v=v}}</nowiki> gives: {{xpdnp|t np2|1n=q|1v=u|2n=s|2v=v}}<br />
*<nowiki>{{xpdopepec|t np2|q|u|s|v}}</nowiki> gives: {{xpdopepec|t np2|q|u|s|v}}<br />
<br />
*<nowiki>{{xpdnp|#switch:q|1n=p|1v=u|2n=q|2v=v}}</nowiki> gives: {{xpdnp|#switch:q|1n=p|1v=u|2n=q|2v=v}}<br />
*<nowiki>{{xpdopepec|#switch:q|p|u|q|v}}</nowiki> gives: {{xpdopepec|#switch:q|p|u|q|v}}<br />
*<nowiki>{{xpd5opepec||||||#switch:q|p|u|q|v}}</nowiki> gives: {{xpd5opepec||||||#switch:q|p|u|q|v}}<br />
<br />
While the template works for templates without parameters it does not work properly for variables:<br />
<br />
*<nowiki>{{xpdnp|CURRENTTIME}}</nowiki> gives: {{xpdnp|CURRENTTIME}}<br />
<br />
Therefore, for variables use {{tim|xpdoc}} instead:<br />
*<nowiki>{{xpdoc|CURRENTTIME}}</nowiki> gives: {{xpdoc|CURRENTTIME}}<br />
<br />
<br />
<!-- template categories and interwiki links --><br />
<includeonly></includeonly></div>WikiMaster