<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://www.tfcmud.com/wiki/index.php?action=history&amp;feed=atom&amp;title=Help%3APage_existence</id>
	<title>Help:Page existence - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://www.tfcmud.com/wiki/index.php?action=history&amp;feed=atom&amp;title=Help%3APage_existence"/>
	<link rel="alternate" type="text/html" href="https://www.tfcmud.com/wiki/index.php?title=Help:Page_existence&amp;action=history"/>
	<updated>2026-05-03T09:39:21Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.36.1</generator>
	<entry>
		<id>https://www.tfcmud.com/wiki/index.php?title=Help:Page_existence&amp;diff=404&amp;oldid=prev</id>
		<title>Tynian: 1 revision: Import helps</title>
		<link rel="alternate" type="text/html" href="https://www.tfcmud.com/wiki/index.php?title=Help:Page_existence&amp;diff=404&amp;oldid=prev"/>
		<updated>2011-01-10T23:24:41Z</updated>

		<summary type="html">&lt;p&gt;1 revision: Import helps&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{h:h}}&lt;br /&gt;
__TOC__&lt;br /&gt;
Wikitext methods to determine whether a page exists:&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!method!!what links here &amp;lt;ref&amp;gt;applying &amp;quot;what links here&amp;quot; on a probed page shows the page on which this method is applied&amp;lt;/ref&amp;gt;!![http://meta.wikimedia.org/w/index.php?title=Help:Page_existence&amp;amp;action=edit transclusion] &amp;lt;ref&amp;gt;the probed page is counted as transcluded onto the page on which this method is applied; this shows up in the edit page of the latter, and on &amp;quot;what links here&amp;quot; on the probed page&amp;lt;/ref&amp;gt;!!limitation!!usage!!interwiki link&amp;lt;ref&amp;gt;applies with a correct prefix, regardless of existence of the linked page&amp;lt;/ref&amp;gt;!!pagename with anchor&lt;br /&gt;
|-&lt;br /&gt;
|#ifexist||[[Special:Whatlinkshere/Existence a|yes]]||no&amp;lt;ref&amp;gt;If a page is conditionally transcluded, namely only if it exists, then if the then-part of the #ifexist is this transclusion, it counts as a transclusion anyway, even if the page does not exist. However, if the then-part of the #ifexist is the ''name'' of the page to be transcluded, and the else-part is e.g. the page &amp;quot;dummy&amp;quot;, and we have outer double braces to transclude the page with this conditional name, then only real transclusions are listed.&amp;lt;/ref&amp;gt;||not more than now 500 on a page&amp;lt;ref&amp;gt;On Wikimedia wikis there is a maximum for the number of distinct pages for which #ifexist is called on a page. A call of #ifexist after a transclusion of the same page does not require an extra database query and is therefore not counted. A call beyond the maximum returns &amp;quot;false&amp;quot;. The html-source of each page shows the counted number of calls, as well as the maximum. The maximum is currently 500, and it has been announced that this will be lowered to 100. [http://en.wikipedia.org/wiki/Wikipedia:Village_pump_%28technical%29/Archive_9#.23ifexist_limit] [http://en.wikipedia.org/wiki/Wikipedia:Village_pump_(technical)/Archive_33#.23ifexist_limit] [[w:wikipedia:Template limits]].&amp;lt;/ref&amp;gt;||branching||&amp;quot;does not exist&amp;quot;||checks page existence correctly, but not the existence of the anchor&lt;br /&gt;
|-&lt;br /&gt;
|#ifeq applied to the transclusion and the link: equality means non-existence; this is applied in {{tim|exists}}, where care is taken that the comparison is insensitive to the applicable conversions||[[Special:Whatlinkshere/Existence b|yes]]||yes|| ||branching||&amp;quot;exists&amp;quot;||&amp;quot;exists&amp;quot;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|[[Help:Link#Wikilinks|linking]]: class=&amp;quot;new&amp;quot; means non-existence||[[Special:Whatlinkshere/Existence c|yes]]||no||none||seeing the page link in a style depending on existence||class=&amp;quot;extiw&amp;quot;||checks page existence correctly, but not the existence of the anchor&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|[[Special:Allpages]]||no||no||none||seeing the page listed or not||not listed||n.a.&lt;br /&gt;
|-&lt;br /&gt;
|[[Special:PrefixIndex]]||no||no||none||seeing the page listed or not||not listed||n.a.&lt;br /&gt;
|}&lt;br /&gt;
Examples:&lt;br /&gt;
*{{xpdop3p3c|#ifexist:Template:Tc|1|||0}}&lt;br /&gt;
*{{xpdop3p3c|#ifexist:existence a|1|||0}}&lt;br /&gt;
*{{xpd5op3p3p3c||||||exists|Template:Tc|||1|||0}}&lt;br /&gt;
*{{xpd5op3p3p3c||||||exists|existence b|||1|||0}}&lt;br /&gt;
*{{xpdop3p3c|exist|Template:Tc|||yes}}&lt;br /&gt;
*[[existence c]]&lt;br /&gt;
*[[Special:Allpages/existence]]&lt;br /&gt;
*[[Special:PrefixIndex/exist]]&lt;br /&gt;
&amp;lt;nowiki&amp;gt;{{Special:PrefixIndex/exist}}&amp;lt;/nowiki&amp;gt; gives:&lt;br /&gt;
&lt;br /&gt;
{{Special:PrefixIndex/exist}}&lt;br /&gt;
&lt;br /&gt;
Another method is, of course, going to the web address concerned and seeing the content or a message that the page does not exist.&lt;br /&gt;
&lt;br /&gt;
==Branching applications==&lt;br /&gt;
A typical application of existence detection is:&lt;br /&gt;
*producing the content of a page if it exists, otherwise some default&lt;br /&gt;
with the important special case: &lt;br /&gt;
*producing the content of a page if it exists, otherwise nothing&lt;br /&gt;
&lt;br /&gt;
If the set of possible pages is limited then an alternative is creating them all, with the extra pages containing the default value(s), and unconditionally transcluding the pages.&lt;br /&gt;
&lt;br /&gt;
==CSS class==&lt;br /&gt;
If existence is checked in order to hide red links, an alternative for &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{#ifexist:foo|[[foo]]}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{exists|foo|[[foo]]}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; is &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;lt;span class=&amp;quot;hidden-redlink&amp;quot;&amp;gt;[[foo]]&amp;lt;/span&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;, giving &amp;quot;&amp;lt;span class=&amp;quot;hidden-redlink&amp;quot;&amp;gt;[[foo]]&amp;lt;/span&amp;gt;&amp;quot;, where we have the CSS specification &lt;br /&gt;
&lt;br /&gt;
 .hidden-redlink a.new { display: none; }&lt;br /&gt;
&lt;br /&gt;
(which on Meta has been added to [[Mediawiki:Common.css]]).&lt;br /&gt;
&lt;br /&gt;
Conversely an emphasized style could be used for red links, or only red links could be displayed.&lt;br /&gt;
&lt;br /&gt;
==Efficiency==&lt;br /&gt;
When checking existence of a page through transclusion, any parameters can be used in the call, as long as the result does not happen to be equal to the link to the page. However, for the [[w:wp:template limits|page counts]] the choice of parameters can make a difference in the case that the page exists. This can be taken into account when checking a possible member of a family of templates, such as those like [[w:Template:Data China]]. If we use 1=void the include size is small, but the preprocessor node count is somewhat large, while if we use for parameter 1 the name of a non-existing template the include size is larger, but the preprocessor node count is smaller; for the latter method preferably a [[w:wp:SALT|salted]] template name ([http://meta.wikimedia.org/w/index.php?title=Special%3AProtectedTitles&amp;amp;namespace=10&amp;amp;level=0 list]) is used. If we do not define parameter 1 it depends on whether the template takes [[w:Template:Show data]] as default (like on the template page itself) or not. If it does, the counts are high.&lt;br /&gt;
&lt;br /&gt;
==Notes==&lt;br /&gt;
{{refs}}&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
*[[w:Wikipedia:Village pump (technical)/Archive 9#Inconsistent limitations?]]&lt;br /&gt;
*[[w:Wikipedia:Village pump (technical)/Archive 9##ifexist limit]]&lt;br /&gt;
*[[w:Wikipedia:Village pump (technical)/Archive 33##ifexist limit]]&lt;br /&gt;
*[[w:Wikipedia:Template limits#Expensive parser function calls]].&lt;br /&gt;
*[[w:Category:Pages with too many expensive parser function calls]]&lt;br /&gt;
&lt;br /&gt;
{{h:f}}&lt;/div&gt;</summary>
		<author><name>Tynian</name></author>
	</entry>
</feed>