Template:Xpdnp/doc

From FamilySearch Wiki
< Template:Xpdnp
Revision as of 09:41, 28 April 2012 by Cottrells (talk | contribs) (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...")

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

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

Examples, compared with equivalent calls of >Template:xpdoc (backlinks, edit), >Template:xpdopec (backlinks, edit), and >Template:xpdopepec (backlinks, edit):

  • {{xpdnp|tc}} gives: {{tc}} 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|#switch:q|1n=p|1v=u|2n=q|2v=v}} gives: {{#switch:q|p=u|q=v}} 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:

Therefore, for variables use >Template:xpdoc (backlinks, edit) instead:

  • {{xpdoc|CURRENTTIME}} gives: "{{CURRENTTIME}} [[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]]" → "11:44" [8]