Jump to content

Template:Always substitute/doc

Kufuma Wikipedia

{{Always substitute}} produces the following notice:

(but the {{Always substitute}} template itself should never be substituted.)

{{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, or always.
  • Setting it to never or not will 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 can or may will 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 always will 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.
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 yes if a Wikipedia bot automatically searches for accidental transclusions of the template this notice refers to and fixes them to be substitutions, unless the |demo=yes parameter is set.
If this parameter is not used, or if it is set to anything other than yes,[1] the template defaults to using no.
|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:Example or |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 than always, 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 true in 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.
  1. 1 2 This template uses {{yesno-no}} to sanitize and parse the input so that the result is either yes or no. As a result, setting this parameter to any input that is construed to be affirmative will also return yes. See template documentation for more information.