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 {{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.

Template parameters

This template prefers inline formatting of parameters.

ParameterDescriptionTypeStatus
Page title1

The page title to be checked. This parameter is case-sensitive, except for the first letter.

Example
Ash's Pikachu
Page namerequired
Value if page exists2

The text to render if the given page exists.

Default
true
Example
"[[Ash's Pikachu]]" exists
Stringoptional
Value if page doesn't exist3

The text to render if the given page doesn't exist. Defaults to an empty string.

Example
"Ash's Pikachu" doesn't exist
Stringoptional

See also