Template:Meta/Help/Substitution

From Library
Jump to navigation Jump to search
For issues involving the substitution of templates, such as how to control whether subtemplates are substituted as well when the parent template is substituted, see Help:Substitution.
The template {{Trim}} can be used to strip any initial or final whitespace from unnamed parameter values if this would cause problems; named parameter values are automatically stripped in this way.
For debugging templates, the following techniques are sometimes helpful:
Use subst: to substitute a template (rather than transcluding it), which can show more clearly what is happening when the template is transcluded; see Help:Substitution.
Use msgnw: (short for "message, nowiki") to more-or-less transclude the wikitext of the template page rather than the processed contents. It is not perfect: lists are rendered, comments are removed, and single newlines are replaced with spaces (which is particularly confounding when transcluding wikitext tables).
Use Special:ExpandTemplates to see the full recursive expansion of one or more templates.