User:Wlgrin/Template/IsNamespaceOfUserSpace/doc

Template checks whether its first unnamed parameter    is the name of one of the namespaces of user space.

Basic usage
Template produces true if its first unnamed parameter    is the name of one of the namespaces from user space; otherwise, it produces false. Namespace names are case-insensitive.

Currently, user space includes two namespaces:
 * which, in this version of Wikipedia, evaluates to “   ” and is used for ordinary user pages.
 * which, in this version of Wikipedia, evaluates to “   ” and is used for user discussion pages.

Note that the parameter passed to this template must only be the name of a namespace (not a full page name) and must not contain the colon separator. If you are working with a page name, first ensure that it is the full page name (for example, obtained with ) and then extract the name of its namespace using.

If no parameter is passed, template tests the namespace of the current page.


 * {| class="wikitable collapsible collapsed" style="min-width:30em;"

!style="text-align:left;"|Examples
 * style="padding:1em;"| For example, using the following call on page “   :MeMysefEtMoi/Archive/2011”:
 * style="padding:1em;"| For example, using the following call on page “   :MeMysefEtMoi/Archive/2011”:

will produce
 * <samp style="padding-left:1em; padding-right:1em; background-color:#F2FFE6;"> true

In this particular case, the same result would have been obtained by calling without parameter:


 * }

Using substitution
Template can be safely substituted, since it uses the “safesubst” modifier to call parser functions and magic words and it does not transclude any other page.

If you wish to substitute template instead of transcluding it, remember to also substitute any parser functions or magic words used in its parameter list. This is because the MediaWiki parser performs all substitutions before performing any transclusion.


 * {| class="wikitable collapsible collapsed" style="min-width:30em;"

!style="text-align:left;"|Examples
 * style="padding:1em;"| For example, using the following incorrect call on page <tt>“   :MeMysefEtMoi/Archive/2011”</tt>:
 * style="padding:1em;"| For example, using the following incorrect call on page <tt>“   :MeMysefEtMoi/Archive/2011”</tt>:

will produce the likely unintended output
 * <samp style="padding-left:1em; padding-right:1em; background-color:#FFF2E6;"> false

because will be substituted before  and  are resolved. By contrast,

will produce, as expected,
 * <samp style="padding-left:1em; padding-right:1em; background-color:#F2FFE6;"> true


 * }