Template:If in category/doc

From Wikipedia, the free encyclopedia

Checks whether a page is in a category, and returns different output based on the answer.

Template parameters

ParameterDescriptionTypeStatus
Page1 page

Page being checked

Page namerequired
Category2 category

Category being checked to see if the page is in it; do not include the prefix

Page namerequired
If yes3 yes

Output if the page is in the category

Contentsuggested
If no4 no

Output if the page is not in the category

Contentsuggested

Example[edit]

{{If in category|Amastra subsoror|Extinct gastropods|Dead as the dodo|Perhaps it's still alive}} produces Dead as the dodo.

Limitations[edit]

This template is very expensive.

Only detects categories directly on a page, not those added indirectly through templates.