Template:Ifexist/doc
This template checks for existence of pages.
The #ifexist parser function exists as part of the ParserFunctions extension, but will put up the checked page title on the list of wanted pages if it doesn't exist (see task 14019 on Wikimedia Phabricator). This template serves as a workaround for this flaw. Use this template sparingly because it also uses an expensive parser function.
How to use
Parameters
| Parameter | Allowed values | Notes |
|---|---|---|
1
|
Page title | The page title to be checked. This parameter is case-sensitive, except for the first letter. |
2
|
String | Optional. The text to render if the page specified in the parameter 1 exists. Defaults to true.
|
3
|
String | Optional. The text to render if the page specified in the parameter 1 doesn't exist. Defaults to an empty string.
|
Example
* The page {{ifexist|Ash's Pikachu|"[[Ash's Pikachu]]" exists|"Ash's Pikachu" doesn't exist}}.
- The page "Ash's Pikachu" exists.
* The page {{ifexist|Ash's Mudkip|"[[Ash's Mudkip]]" exists|"Ash's Mudkip" doesn't exist}}.
- The page "Ash's Mudkip" doesn't exist.
TemplateData
This template checks for existence of pages.
| Parameter | Description | Type | Status | |
|---|---|---|---|---|
| Page title | 1 | The page title to be checked. This parameter is case-sensitive, except for the first letter.
| Page name | required |
| Value if page exists | 2 | The text to render if the given page exists.
| String | optional |
| Value if page doesn't exist | 3 | The text to render if the given page doesn't exist. Defaults to an empty string.
| String | optional |
See also
- Template:Linkless exists on the English Wikipedia