ಟೆಂಪ್ಲೇಟು:Subst check top/doc

ವಿಕಿಪೀಡಿಯದಿಂದ, ಇದು ಮುಕ್ತ ಹಾಗೂ ಸ್ವತಂತ್ರ ವಿಶ್ವಕೋಶ

Usage[ಬದಲಾಯಿಸಿ]

Place this template and {{Substcheckbottom}} onto the main template in the following manner.

{{{{{|safesubst:}}}substchecktop|[template pagename]|subst={{{subst|}}}}}

...template code...

{{{{{|safesubst:}}}substcheckbottom|subst={{{subst|}}}}}

This template, along with {{Substcheckbottom}}, will check the main template for substitution and give an error message if it has been accidentally transcluded by having this template placed above the main template code and {{Substcheckbottom}} placed below the main template code.

This template takes in an input for the main template name as a parameter. This is shown above as [template pagename]. This parameter should be entered so that the default error message refers to the correct main template. This default error message can be optionally replaced by a custom error message by using the message parameter. This parameter accepts templates and it is recommended that a message template be used for long messages to keep the parameter value short. {{Substcheckbottom}} takes in an input for categories. This is so that unsubstituted versions of the main template can still categorise pages. This can be done by adding the name of the category to the category parameter. There is also a sort parameter to allow category sorting.

Both this template and {{Substcheckbottom}} use subst={{{subst|}}} as one of the parameters. This allows optional transclusion for demonstration purposes by setting the subst parameter on the main template to nosubst.

Related templates[ಬದಲಾಯಿಸಿ]

List of subst helper templates
  • {{Require subst}}: Prints an error unless substituted.
    • {{Subst check top}}{{Subst check bottom}}: Same purpose, but used as a pair.
    • {{Subst only}}: For the doc of the above templates; prints a message asking for it be substituted.
    • {{Nosubst}}: The reverse of {{Subst only}}. For the doc of templates which should not be substituted; prints a message asking for it not to be substituted.
  • {{Issubst}}: Returns "yes" if substituted.
  • {{Ifsubst}}: Forks if substituted or not.