Template:Test-params/doc

From Angelina Jordan Wiki
Revision as of 09:24, 3 August 2022 by Dcljr (talk | contribs) (doc created)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
This is a subpage documenting Template:Test-params. To change the template, edit that page; to change the template's documentation (seen below), edit this one.

Documentation

This template exists only to collect examples that illustrate certain vagaries of MediaWiki templates and parser functions, including especially cases where whitespace is or is not preserved, and is or is not significant.

This is obviously only for the benefit of template editors (and maybe users) on this wiki. The template should generally not be used outside of the documentation of the template itself (and possibly on talk pages, to diagnose/explain problems with template calls).

Usage

See examples.

Examples

  • {{test-params}} ⇒ 1 undefined; 2 undefined; fallback value = "default"
  • {{test-params|}} ⇒ 1 defined and false (); 2 undefined; fallback value = ""
  • {{test-params| }} ⇒ 1 defined and false ( ); 2 undefined; fallback value = " "
  • {{test-params|1=}} ⇒ 1 defined and false (); 2 undefined; fallback value = ""
  • {{test-params|1= }} ⇒ 1 defined and false (); 2 undefined; fallback value = ""
  • {{test-params|1=foo}} ⇒ 1 defined and true (foo); 2 undefined; fallback value = "foo"
  • {{test-params|foo}} ⇒ 1 defined and true (foo); 2 undefined; fallback value = "foo"
  • {{test-params||}} ⇒ 1 defined and false (); 2 defined and false (); fallback value = ""
  • {{test-params| |}} ⇒ 1 defined and false ( ); 2 defined and false (); fallback value = " "
  • {{test-params|1=|}} ⇒ 1 defined and false (); 2 undefined; fallback value = "" (bad call: 1 defined twice)
  • {{test-params|1= |}} ⇒ 1 defined and false (); 2 undefined; fallback value = "" (bad call: 1 defined twice)
  • {{test-params|1=foo|}} ⇒ 1 defined and false (); 2 undefined; fallback value = "" (bad call: 1 defined twice)
  • {{test-params|foo|}} ⇒ 1 defined and true (foo); 2 defined and false (); fallback value = "foo"
  • {{test-params|| }} ⇒ 1 defined and false (); 2 defined and false ( ); fallback value = ""
  • {{test-params| | }} ⇒ 1 defined and false ( ); 2 defined and false ( ); fallback value = " "
  • {{test-params|1=| }} ⇒ 1 defined and false ( ); 2 undefined; fallback value = " " (bad call: 1 defined twice)
  • {{test-params|1= | }} ⇒ 1 defined and false ( ); 2 undefined; fallback value = " " (bad call: 1 defined twice)
  • {{test-params|1=foo| }} ⇒ 1 defined and false ( ); 2 undefined; fallback value = " " (bad call: 1 defined twice)
  • {{test-params|foo| }} ⇒ 1 defined and true (foo); 2 defined and false ( ); fallback value = "foo"
  • {{test-params||2=}} ⇒ 1 defined and false (); 2 defined and false (); fallback value = ""
  • {{test-params| |2=}} ⇒ 1 defined and false ( ); 2 defined and false (); fallback value = " "
  • {{test-params|1=|2=}} ⇒ 1 defined and false (); 2 defined and false (); fallback value = ""
  • {{test-params|1= |2=}} ⇒ 1 defined and false (); 2 defined and false (); fallback value = ""
  • {{test-params|1=foo|2=}} ⇒ 1 defined and true (foo); 2 defined and false (); fallback value = "foo"
  • {{test-params|foo|2=}} ⇒ 1 defined and true (foo); 2 defined and false (); fallback value = "foo"
  • {{test-params||2= }} ⇒ 1 defined and false (); 2 defined and false (); fallback value = ""
  • {{test-params| |2= }} ⇒ 1 defined and false ( ); 2 defined and false (); fallback value = " "
  • {{test-params|1=|2= }} ⇒ 1 defined and false (); 2 defined and false (); fallback value = ""
  • {{test-params|1= |2= }} ⇒ 1 defined and false (); 2 defined and false (); fallback value = ""
  • {{test-params|1=foo|2= }} ⇒ 1 defined and true (foo); 2 defined and false (); fallback value = "foo"
  • {{test-params|foo|2= }} ⇒ 1 defined and true (foo); 2 defined and false (); fallback value = "foo"
  • {{test-params||2=bar}} ⇒ 1 defined and false (); 2 defined and true (bar); fallback value = ""
  • {{test-params| |2=bar}} ⇒ 1 defined and false ( ); 2 defined and true (bar); fallback value = " "
  • {{test-params|1=|2=bar}} ⇒ 1 defined and false (); 2 defined and true (bar); fallback value = ""
  • {{test-params|1= |2=bar}} ⇒ 1 defined and false (); 2 defined and true (bar); fallback value = ""
  • {{test-params|1=foo|2=bar}} ⇒ 1 defined and true (foo); 2 defined and true (bar); fallback value = "foo"
  • {{test-params|1= foo |2= bar }} ⇒ 1 defined and true (foo); 2 defined and true (bar); fallback value = "foo"
  • {{test-params|foo|2=bar}} ⇒ 1 defined and true (foo); 2 defined and true (bar); fallback value = "foo"
  • {{test-params||bar}} ⇒ 1 defined and false (); 2 defined and true (bar); fallback value = ""
  • {{test-params| |bar}} ⇒ 1 defined and false ( ); 2 defined and true (bar); fallback value = " "
  • {{test-params|1=|bar}} ⇒ 1 defined and true (bar); 2 undefined; fallback value = "bar" (bad call: 1 defined twice)
  • {{test-params|1= |bar}} ⇒ 1 defined and true (bar); 2 undefined; fallback value = "bar" (bad call: 1 defined twice)
  • {{test-params|1=foo|bar}} ⇒ 1 defined and true (bar); 2 undefined; fallback value = "bar" (bad call: 1 defined twice)
  • {{test-params|foo|bar}} ⇒ 1 defined and true (foo); 2 defined and true (bar); fallback value = "foo"
  • {{test-params| foo | bar }} ⇒ 1 defined and true ( foo ); 2 defined and true ( bar ); fallback value = " foo "
  • {{test-params|ignored=}} ⇒ 1 undefined; 2 undefined; fallback value = "default" (named param not checked for)
  • {{test-params|ignored=|}} ⇒ 1 defined and false (); 2 undefined; fallback value = "" (named param not checked for)
  • {{test-params||ignored=}} ⇒ 1 defined and false (); 2 undefined; fallback value = "" (named param not checked for)
  • {{test-params||ignored=|}} ⇒ 1 defined and false (); 2 defined and false (); fallback value = "" (named param not checked for)