Template:Exists/doc
About
This template is a port of Metawiki's Template:Exists as a more efficient way to validate page names without using #ifexists
and/or to bypass the limited number of times #ifexists
can be called on an individual page.
Syntax
The full syntax for this template is:
{{exists | page=''page'' | then=''result if page exists'' | else=''result if page does not exist'' }}
The parameters then
and else
are optional; if not given, the default values for then
and else
are 1 and 0 respectively. The page name may alternatively be given as the first unnamed parameter, as in this short version:
{{exists | ''page'' }}
The method is based on transclusion of the possibly existing page. If the page does not exist the code for page transclusion produces a (red) link. Even if this result is used for comparison only, and not for final output, the page counts as being transcluded. Therefore the page appears as red link in the list of transcluded pages.
For additional information, please see the page on Metawiki this template was ported from. You can find it here.