Template:If in category/doc
Appearance
![]() | This is a documentation subpage for Template:If in category. It may contain usage information, categories and other content that is not part of the original template page. |
![]() | 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
[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.