Template:Always substitute
|
|
This template should always be substituted – use {{subst:Example}}. |
| This template uses Lua: |
|
|
This template should never be substituted – use {{Always substitute}}. |
| This template is used on approximately 9,300 pages and changes may be widely noticed. Test changes in the template's /sandbox or /testcases subpages, or in your own user subpage. Consider discussing changes on the talk page before implementing them. |
{{Always substitute}} produces the following notice:
This template should always be substituted – use {{subst:foo}}.
(but the {{Always substitute}} template itself should never be substituted.)
Usage
[kulemba source]{{Always substitute}}
{{Always substitute}} should be placed on the documentation subpage of any template that requires substitution rather than transclusion (not on the template's own page itself).
Parameters
[kulemba source]All of the parameters for this template are optional. If none of the parameters are used when transclusing this template onto the documentation subpage of a template, it will default to displaying a notice stating that the template "should always be substituted", and include a statement with the template syntax that the reader should always use in order to substitute it onto a page. No additional statements are amended to the notice, and automatic categorization of the template that this notice refers to is allowed.
|yesnomaybe=- Can be set to
never,not,can,may, oralways.- Setting it to
neverornotwill display a notice stating that the template "should never be substituted" or "should not be substituted", respectively – and display the template syntax that the reader should always use in order to transclude it onto a page. - Setting it to
canormaywill display a notice stating that the template "can be substituted" or "may be substituted", respectively – and display the template syntax that the reader can use in order to substitute it onto a page if they so choose. - Setting it to
alwayswill display a notice stating that the template "should always be substituted" – and display the template syntax that the reader should always use in order to substitute it onto a page.
- Setting it to
- If this parameter is not used, or if it is set to anything not listed above, the template defaults to using
always. |auto=yes- Set this parameter to
yesif a Wikipedia bot automatically searches for accidental transclusions of the template this notice refers to and fixes them to be substitutions, unless the|demo=yesparameter is set.- When set to
yes, the notice will include a statement with this information to the reader, as well as place the template that the notice refers to in Category:Wikipedia templates to be automatically substituted; see User:AnomieBOT/docs/TemplateSubster for more information. - This parameter is ignored by the template if
|yesnomaybe=is set to an option other thanalways, since this would cause the template to show conflicting information to the reader that makes no sense.
- When set to
- If this parameter is not used, or if it is set to anything other than
yes,[1] the template defaults to usingno. |alt=- Set this parameter to the page title or location of an alternate template that the reader should use for transclusion instead of the template that the notice refers to (e.g.
|alt=Template:Exampleor|alt=Example).- Enter the page title or location using plain text, and do not include quotations, square brackets, or braces.
- When set to a page title or location, the notice will include a statement instructing the reader to use the alternate template for transclusions, and provide the appropriate template syntax for the reader to use.
- If the location includes "Template:" or "TM:" at the beginning of the text, it is automatically dropped from being displayed in the template syntax.
- This parameter is ignored by the template if
|yesnomaybe=is set to an option other thanalways, since this would cause the template to show conflicting information to the reader that makes no sense.
- If this parameter is not used, or if it is set to no value or to only whitespace characters, the template will default to not displaying the additional information to the reader.
|nocat=true- Set this parameter to
truein order to suppress automatic categorization of the template that it applies to.
- If this parameter is not used, or if it is set to anything other than
yes,[1] the template defaults to allowing automatic categorization.
Categorization
[kulemba source]Pages that include {{Always substitute}} are added to Category:Wikipedia substituted templates.
Templates that subst a template name string onto the target page in hidden text are added to Category:Templates with matching hidden id if and only if the hidden template name string matches the name of the template. For example: Template:Uw-coi contains the token <!-- Template:Uw-coi -->, and since the token matches the Template name, Template:Uw-coi is a member of the category.
List of subst helper templates
[kulemba source]- {{require substitution}} – Prints an error unless substituted.
- {{ifsubst}} – if-then-else metatemplate that checks if a template is currently being substituted or transcluded.
- {{always substitute}} – For the doc of the above templates; prints a message asking for it be substituted.
- {{frequently substituted}} – Notice displayed in the documentation of substitution templates notifying the user that the template is widely used.
- {{never substitute}} – The reverse of {{always substitute}} . For the doc of templates which should not be substituted; prints a message asking for it not to be substituted.
- {{can be substituted}} – For the doc of templates whose substitution is optional.
- {{may be substituted}} – Same as the template above, but with the adverb may being used in the notice (instead of can).
- {{substitution}} – Allows free-fill description of whether the template should be substituted and under what conditions.
- {{issubst}} – Returns "yes" if substituted.
- {{HTML comment}} – To sign substitutions with comments that contain wikitext expansions.
- Module:Unsubst – Prevents substitution.
- Module:Unsubst-infobox – Prevents substitution for infoboxes, cleans up parameters.
Notes
[kulemba source]- 1 2 This template uses {{yesno-no}} to sanitize and parse the input so that the result is either
yesorno. As a result, setting this parameter to any input that is construed to be affirmative will also returnyes. See template documentation for more information.