Template:If page exists
Jump to navigation
Jump to search
true
[edit] [ ] Template documentation
This documentation is transcluded from Template:If page exists/doc. (edit | history)
Editors can experiment in this template's sandbox (create) and test cases (create) pages.
Subpages of this template.
Editors can experiment in this template's sandbox (create) and test cases (create) pages.
Subpages of this template.
Description
Sometimes editors wish to write code that handles things differently depending on whether a given page exists or doesn't exist. A parser function {{#ifexist:…}}
is ordinarily used for that purpose. A side effect is that the checked page is added to Special:WantedPages:
- This is desirable for templates like {{RL}}, as it helps build reports of pages that would be and should be linked, if someone would write those pages
- For many other scenarios, it's an unwanted side effect, and this template should be used instead of
{{#ifexist:…}}
In other words, this template is like {{#ifexist:…}}
without the backlink, hence its Wikipedia name Template:Linkless exists, which redirects here.
Usage
{{If page exists|page|if exists|if does not exist}}
See also
- {{RL}}
Further reading
- Help:Extension:ParserFunctions § #ifexist at MediaWiki
- Bug report T14019 at Phabricator
- Template:Linkless exists at Wikipedia
History
This was lifted from Wikipedia with {{Navbar}} in mind: as a subroutine of {{Navbox}}, it's used frequently on navigation templates that need no discussion; and replacing the code was intended to remove useless links cluttering Special:WantedPages.
This template was originally sporked from wikipedia:Template:Linkless exists. |