Jump to content

Help:Substitution: Difference between revisions

no edit summary
m (1 revision imported)
No edit summary
 
Line 1: Line 1:
{{short description|Help about using templates}}
{{short description|Help about using templates}}
{{for|detailed guidance on when to use substitution rather than transclusion|Wikipedia:Substitution}}
{{for|detailed guidance on when to use substitution rather than transclusion|Wikipedia:Substitution}}
{{Wikipedia how-to|H:SUBST}}
'''Substitution''' is a function whereby, when an editor saves a page, an item in the wikicode is permanently replaced with its current value. In particular, [[Help:Template|templates]] and [[Help:Magic words|magic words]] can be substituted, as an alternative to [[Help:Transclusion|transclusion]]. The difference is that when a template is substituted on a page, its appearance on that page will no longer be affected by later changes made to the template itself (as is the case in a transcluded template).
'''Substitution''' is a function whereby, when an editor saves a page, an item in the wikicode is permanently replaced with its current value. In particular, [[Help:Template|templates]] and [[Help:Magic words|magic words]] can be substituted, as an alternative to [[Help:Transclusion|transclusion]]. The difference is that when a template is substituted on a page, its appearance on that page will no longer be affected by later changes made to the template itself (as is the case in a transcluded template).


Substitution is done using the <code>subst:</code> modifier after the double opening braces. For example, to substitute the template {{tl|afd}}, type <code><nowiki>{{subst:afd}}</nowiki></code>. You can check the resulting wikitext before saving by clicking "Show changes" (and see what the page will look like by clicking "Show preview").
Substitution is done using the <code>subst:</code> modifier after the double opening braces. For example, to substitute the template {{tl|afd}}, type <code><nowiki>{{subst:afd}}</nowiki></code>. You can check the resulting wikitext before saving by clicking "Show changes" (and see what the page will look like by clicking "Show preview").


[[Help:variable|Variable]]s and [[Help:parser function|parser function]]s can also be substituted, meaning that their current value will be recorded permanently on the page – they will not be re-evaluated whenever someone views the page.
Variables and [[Help:Parser functions|parser functions]] can also be substituted, meaning that their current value will be recorded permanently on the page – they will not be re-evaluated whenever someone views the page.


==When to use substitution==
==When to use substitution==