Template:Exists: Difference between revisions

From VNDev Wiki
Initial
 
Don't create wanted template either
 
Line 1: Line 1:
{{#ifeq:{{anchorencode:{{lc:[[:{{{page|{{{1|defaultFalse}}}}}}]]}}}}|{{anchorencode:{{lc:{{:{{{page|{{{1|defaultFalse}}}}}}}}}}}}|{{{else|0}}}|{{{then|1}}}}}<noinclude>{{documentation}}</noinclude>
{{#if:{{PROTECTIONEXPIRY:edit|{{{1|}}}}}|{{{2|true}}}|{{{3|}}}}}<noinclude>{{documentation}}</noinclude>

Latest revision as of 20:10, 18 June 2022

true

Documentation icon Template documentation [view] [edit] [purge]

This template tests whether a given page exists. This is meant to replace the #ifexist parser function which creates unnecessary links in Special:WantedPages in a page does not exist. This has the advantage of avoiding spurious wikilinks, but has the disadvantage that the containing page may not be updated automatically if the checked page is created or deleted later.

Usage

The full syntax for using it is:

{{exists|page}}

{{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 true and <blank> respectively.