Template:Substcheck/doc

This template can be used in conditional processing in other templates to detect substitutions.

If you use Module:Unsubst, you need not use this template.

Usage
If you put  into a template, it will expand into one of the following, depending how the template is being viewed.
 * SUBST if the template is being substituted
 * if the template is being transcluded
 * Empty string if you are viewing the template page.

Using this template differently may yield different results; the above is the most universal way.