Template:Nousercat

From Lantern Hill
Jump to: navigation, search

Usage

This template assigns a page to the corresponding user category (Category:User subpages, Category:User templates, or Category:User subtemplates, depending on the name of category specified) (if the page is in userspace) or to the specified category (if the page is not in userspace).

This template allows other templates which would normally assign categories to be used in userspace pages without assigning mainspace categories. It is also useful when creating userspace pages planned to be moved to the main namespace.

When a page is moved from userspace to the mainspace, all of the previously blocked categories will be assigned.

{{Nousercat|<!--name of category-->|<!--OPTIONAL Category sort -->}}

Notes

  • If the article is in mainspace, the article will always be assigned to the specified category.
  • If the article is in userspace and 'Subtemplates' is specified, the article with be assigned to Category:User subtemplates.
  • For template articles, Template:Nousercat checks if the assigned template ends in 'Templates' or 'templates', or if its parent category is 'Templates', and assigns it to either Category:User templates or the appropriate mainspace template category as appropriate. For example, if in userspace, adding {{Nousercat|Templates}}, {{Nousercat|DPL Templates}}, or {{Nousercat|Page Elements}} to an article's source text will assign the article to to Category:User templates. If the same article was then moved to the main template namespace (Template:<article name>), then Category:Templates, Category:DPL Templates, or Category:Page Elements, respectively, would be used.
  • If the aticle is in userspace, and the specified category is not 'Templates' or end with 'templates', and it is not 'Subtemplates', then Category:User subpages is assigned.