Anonymous user
Module:Unsubst/doc: Difference between revisions
From the Croc Wiki, the Croc encyclopedia
Jump to navigationJump to search
cleanup some markup
m (+ note for infoboxes) |
(cleanup some markup) |
||
Line 1:
<!-- Categories where indicated at the bottom of this page, please. -->
{{High-risk|2,200,000+}}
{{Module rating|protected}}
Line 14 ⟶ 13:
To turn a template into a self-substituting template, wrap the existing template code with:
<pre>
{{
[ ... existing template code ... ]
Line 23 ⟶ 22:
The wikitext to display when not substed must be given as "$B". All other parameters passed to the #invoke will be copied to the generated template invocation as default values. If the value of any of these default parameters is "__DATE__", that value in the generated template invocation will be the current month and year.
Some templates have a
==== Advanced ====
<pre>
{{
[ ... existing template code ... ]
Line 41 ⟶ 40:
Parameter {{para|$flags}} can be used to modify other facets of the module's behaviour; entries are comma-separated. Valid flags are <code>override</code> (allows parameters in the #invoke: to take precedence over parameters in the original template invocation); <code>keep-whitespace</code> (prevents whitespace from being trimmed from unnamed parameters); and <code>remove-empty</code> (removes empty parameters).
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>
=== Example ===
Consider a template Template:Example containing the following code:
<pre>
{{
[ ... Template code goes here ... ]
Line 56 ⟶ 55:
! Original !! Result
|-
|
|-
|
|-
|
|-
|
|}
<includeonly>{{
| <!-- Categories below this line, please; interwikis at Wikidata -->
[[Category:Wikipedia metatemplates]]
|