Template:If-exist
Appearance
| This template uses Lua: |
This template exists to be an optional template to be used by users instead of using {{If|exist|page name|then|else}} which might be a bit tricky. This template can be used with other template without causing any error(s).
In addition to pages, this template can also check media files' existence.
Usage
[edit]{{If-exist|page name|[then this]|[else this]}} or {{If|exist|page name|[then this]|[else this]}}
Alternative
{{#ifexist:page name|[then this]|[else this]}}
Examples
[edit]| Markup | Renders | {{If-exist|Example|[[Example]] exists|'''Example''' doesn't exists}}
|
Example exists | {{If-exist|Template:{{PAGENAME}}/doc|This page has a documentation subpage|This page doesn't have a documentation subpage}}
|
This page has a documentation subpage |
|---|
See also
[edit]- {{If}}
- {{Ifnotempty}}
- {{Ifexist not redirect}}