Template:Subst check top/doc

Usage
Place onto the main template in the following manner.

will check the main template for substitution and give an error message if it has been accidentally transcluded by having placed above the main template code and  placed below the main template code.

takes in an input for the main template name as a parameter. This is shown above as. 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. 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 use   as one of the parameters. This allows optional transclusion for demonstration purposes by setting the subst parameter on the main template to nosubst.