Modèle:Substituted template/doc

De Wikisisar
Aller à : navigation, rechercher

{{#ifeq:doc |doc

    | 

{{#ifeq:show |show

|
        }}{{#if: |
         |   {{#ifexist:Modèle:Substituted template
                  | [[Category:{{#switch:Modèle |Template=Template |Module=Module |User=User |#default=Wikipedia}} documentation pages]]
                  |
                 }}
        }}
    | 
   }}

Usage

This requires a basic understanding of templates:

  • Substitution is a one-time copying of a template
  • Transclusion is an updating copy of the template

For example, you can add Template:Refimprove section as {{Refimprove section}}. In the editing window it should appear as:

{{Refimprove section}}

which is relatively simple.

However, if someone uses the keyword subst: in front of the template ({{subst:Refimprove section}}), the template will disappear and be replaced with its internal workings:

{ {{{|safesubst:}}}#invoke:Unsubst||$N=Refimprove section |date=__DATE__ |$B=
{{refimprove|section
| name  = Refimprove section
| subst = <includeonly>{{subst:</includeonly><includeonly>substcheck}}</includeonly>
| date  = {{{date|}}}
| talk  = {{{talk|}}}
}}
}}

This is very confusing to most users, and doesn't allow them to easily understand what the code does. It also makes it much easier to mess up. As a general rule, all cleanup tags in articles should not be substituted.
If you see a template substituted in an article when it shouldn't be—and you understand what you're doing—either replace it yourself or ask at the Wikipedia:Village pump (technical).

See also