Template:Exists/doc: Difference between revisions
From VNDev Wiki
Created page with "{{Documentation subpage}} 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. ==Usage== The full syntax for using it is: {{tlx|exists|page}} {{tlx|exists|page=''page''|then=''result if page exists''|else=''result if page does not exist''}} The parameters <code>then</code> and <code>else</code> are optional; if not given, the default..." |
No edit summary |
||
Line 1: | Line 1: | ||
{{Documentation subpage}} | {{Documentation subpage}} | ||
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 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== | ==Usage== | ||
Line 7: | Line 7: | ||
{{tlx|exists|page}} | {{tlx|exists|page}} | ||
{{tlx|exists|page{{=}}''page''|then{{=}}''result if page exists''|else{{=}}''result if page does not exist''}} | |||
The parameters <code>then</code> and <code>else</code> are optional; if not given, the default values for <code>then</code> and <code>else</code> are ''true'' and ''<blank>'' respectively. | |||
The | |||
Latest revision as of 20:13, 18 June 2022
This is a documentation subpage for Template:Exists. It contains usage information, categories and other content that is not part of the original template page. |
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.