Template:Require subst: Difference between revisions

From Xenharmonic Wiki
Jump to navigation Jump to search
ArrowHead294 (talk | contribs)
mNo edit summary
ArrowHead294 (talk | contribs)
mNo edit summary
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
<includeonly>{{safesubst:<noinclude />#if: {{{nosubst|{{{subst|}}}}}}{{safesubst:<noinclude />issubst}}|{{{1|}}}|{{safesubst:<noinclude />error|This template must be {{w|wp:Template substitution|substituted}}.{{safesubst:<noinclude />#if: {{{template|}}}|&#32;Replace <nowiki>{{</nowiki>{{{template}}} ...<nowiki>}} with {{</nowiki>subst:{{{template}}} ...<nowiki>}}</nowiki>}}.}}}}</includeonly><noinclude>
<includeonly>{{safesubst:#if: {{{nosubst|{{{subst|}}}}}}{{safesubst:issubst}}|{{{1|}}}|{{safesubst:error|This template must be {{w|wp:Template substitution|substituted}}.{{safesubst:#if: {{{template|}}}|&#32;Replace <nowiki>{{</nowiki>{{{template}}} ...<nowiki>}} with {{</nowiki>subst:{{{template}}} ...<nowiki>}}</nowiki>}}.}}}}</includeonly><noinclude>
{{documentation}}
{{documentation}}


[[Category:Alert templates]]
[[Category:Metatemplates]]
</noinclude>
</noinclude>

Latest revision as of 16:16, 11 February 2026

Template documentation[view] [edit] [history] [purge]
This template is a metatemplate. It is used to build other templates and should not be used standalone, except for testing or simple usage.
English Wikipedia has an article on:

This is a metatemplate that can be wrapped around a template that requires substitution. It should always be safe-substituted (e.g. {{safesubst:require subst}}).

<includeonly>{{safesubst:require subst|template= [Name of template] |1=</includeonly>
… (normal template code) …
<includeonly>}}</includeonly>

If a substituted template is transcluded instead of substituted, an error message is displayed. For example:

This template must be substituted. Replace {{template name …}} with {{subst:template name …}}.