Module:Unsubst/doc: Difference between revisions
Correct the examples' output based on my real testing at https://en.wikipedia.org/w/index.php?title=Wikipedia:Sandbox&diff=prev&oldid=1234444513
 >Tomoneill m (Text replacement - "Category:Wikipedia metatemplates" to "Category:Powerpedia metatemplates")  | 
				 (Correct the examples' output based on my real testing at https://en.wikipedia.org/w/index.php?title=Wikipedia:Sandbox&diff=prev&oldid=1234444513)  | 
				||
| Line 1: | Line 1: | ||
<!-- Categories where indicated at the bottom of this page, please. -->  | <!-- Categories where indicated at the bottom of this page, please. -->  | ||
{{  | {{high-risk|all=pages=yes}}  | ||
{{Module rating|protected}}  | {{Module rating|protected}}  | ||
Maintenance templates, such as {{tl|Citation needed}} or {{tl|Refimprove}}, should never be substituted. A trick to avoid that is to make a template substitute to its transcluded form. This module implements that trick.  | |||
Maintenance templates, such as {{tl|Citation needed}} or {{tl|Refimprove}}, should never be substituted. A trick to avoid that is to make a template substitute to its transcluded form.  | |||
Infoboxes should use [[Module:Unsubst-infobox]], as should any other templates with parameters listed in block format by default.  | Infoboxes should use [[Module:Unsubst-infobox]], as should any other templates with parameters listed in block format by default.  | ||
| Line 41: | Line 39: | ||
These parameters can be manipulated using parser functions to provide more complicated options (note that in the parameters any parser function, or template or module invocation, should also have <code><nowiki>SAFESUBST:<noinclude /></nowiki></code>).  | These parameters can be manipulated using parser functions to provide more complicated options (note that in the parameters any parser function, or template or module invocation, should also have <code><nowiki>SAFESUBST:<noinclude /></nowiki></code>).  | ||
Parameter {{para|$template-name}} will override the subst'd template's name with the template name assigned to this parameter.  | |||
=== Example ===  | === Example ===  | ||
| Line 55: | Line 55: | ||
! Original !! Result  | ! Original !! Result  | ||
|-  | |-  | ||
| {{tlsc|example}} || {{tlc|Example  | | {{tlsc|example}} || {{tlc|Example|date{{=}}{{#time:F Y}}|foo{{=}}bar}}  | ||
|-  | |-  | ||
| {{tlsc|example|foo{{=}}X}} || {{tlc|Example  | | {{tlsc|example|foo{{=}}X}} || {{tlc|Example|date{{=}}{{#time:F Y}}|foo{{=}}X}}  | ||
|-  | |-  | ||
| {{tlsc|example|baz{{=}}X}} || {{tlc|Example  | | {{tlsc|example|baz{{=}}X}} || {{tlc|Example|baz{{=}}X|date{{=}}{{#time:F Y}}|foo{{=}}bar}}  | ||
|-  | |-  | ||
| {{tlsc|example|date{{=}}January 2001}} || {{tlc|Example|  | | {{tlsc|example|date{{=}}January 2001}} || {{tlc|Example|date{{=}}January 2001|foo{{=}}bar}}  | ||
|}  | |}  | ||
<includeonly>{{sandbox other||  | <includeonly>{{sandbox other||  | ||
| <!-- Categories below this line, please; interwikis at Wikidata -->  | | <!-- Categories below this line, please; interwikis at Wikidata -->  | ||
[[Category:  | [[Category:Wikipedia metatemplates]]  | ||
[[Category:Modules that add a tracking category]]  | [[Category:Modules that add a tracking category]]  | ||
}}</includeonly>  | }}</includeonly>  | ||