Plantilla:Cat ns

De La Coppermind
Ir a la navegación Ir a la búsqueda

This template adds the category given in its first parameter to the page after making certain checks against the page namespace. More specifically:

  1. If an only parameter is passed, the category will be added only if the page is in the namespace specified in that parameter
    Note: In most cases, you can use the name of the namespace. Since the main namespace has no official name, you must instead use the namespace number—which is 0 for the main namespace—in that case.
  2. The category will not be added if the page is in the User namespace, unless the allow-user parameter is passed
  3. If an exclude parameter is passed, the category will not be added if the page is in the namespace specified in that parameter

Additionally, the template supports a key parameter, to change how the page sorts in the category

Examples

  • {{cat ns|Lorem ipsum}} - Adds page to Category:Lorem ipsum unless in the User namespace
  • {{cat ns|Lorem ipsum|allow-user=y}} - Adds page to Category:Lorem ipsum even if in the User namespace
  • {{cat ns|Lorem ipsum|only=0}} - Adds page to Category:Lorem ipsum only if in the article namespace
  • {{cat ns|Lorem ipsum|only=Summary}} - Adds page to Category:Lorem ipsum only if in the Summary namespace
  • {{cat ns|Lorem ipsum|exclude=Category}} - Adds page to Category:Lorem ipsum unless in the User or Category namespaces

Articles using Template