Template:If in category
This template is rated as pre-alpha. It is unfinished, and may or may not be in active development. It should not be used from article namespace pages. Templates remain pre-alpha until the original editor (or someone who takes one over if it is abandoned for some time) is satisfied with the basic structure. |
Checks whether a page is in a category, and returns different output based on the answer.
Parameter | Description | Type | Status | |
---|---|---|---|---|
Page | 1 page | Page being checked | Page name | required |
Category | 2 category | Category being checked to see if the page is in it; do not include the prefix | Page name | required |
If yes | 3 yes | Output if the page is in the category | Content | suggested |
If no | 4 no | Output if the page is not in the category | Content | suggested |
Example
{{If in category|Amastra subsoror|Extinct gastropods|Dead as the dodo|Perhaps it's still alive}}
produces Perhaps it's still alive.
Limitations
This template is very expensive.
Only detects categories directly on a page, not those added indirectly through templates.