Template:If in category/doc: Difference between revisions
Appearance
imported>Deadfire m →Example |
Tungstenchan (talk | contribs) m Text replacement - "BattleTechWiki" to "BattleIntelligence" |
||
| Line 47: | Line 47: | ||
<includeonly>{{sandbox other|| | <includeonly>{{sandbox other|| | ||
<!-- Categories below this line --> | <!-- Categories below this line --> | ||
[[Category: | [[Category:BattleIntelligence categorization]] | ||
[[Category:If-then-else templates]] | [[Category:If-then-else templates]] | ||
}}</includeonly> | }}</includeonly> | ||
Latest revision as of 01:11, 1 May 2025
| 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. |
| Due to a server limit of 500 "expensive parser function" calls (e.g. #ifexist:, PAGESIZE:, and PAGESINCATEGORY:), this template will only work properly if the page using it has not already exceeded the limit. When the limit is exceeded, the page using this template or module is categorised in Category:Pages with too many expensive parser function calls. (further information) |
| This template uses Lua: |
Checks whether a page is in a category, and returns different output based on the answer.
| Parameter | Description | Type | Status | |
|---|---|---|---|---|
| Category | 1 | Category being checked to see if the page is in it; "Category:" prefix is optional
| Page name | required |
| If yes | 2 | Output if the page is in the category. If neither "If yes" nor "If no" are set, defaults to "yes". | Content | suggested |
| If no | 3 | Output if the page is not in the category | Content | suggested |
| Page | page | Page being checked. Defaults to the current page.
| Page name | optional |
Example
{{If in category|page=Atlas|100 ton BattleMechs|Dead as the dodo|Perhaps it's still alive}} produces Dead as the dodo.