Template:If page exists/doc

From Uncyclopedia, the content-free encyclopedia
Jump to navigation Jump to search
This is a documentation subpage for Template:If page exists.
It contains usage information, categories and other content that is not part of the original template page.
To view the template page itself, see Template:If page exists.

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

Further reading

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.

Spork.jpg This template was originally sporked from wikipedia:Template:Linkless exists.