Template:Linkless exists/doc: Difference between revisions

From Tardis Wiki, the free Doctor Who reference
(+module link; update for alternative now deleted)
No edit summary
 
(6 intermediate revisions by 5 users not shown)
Line 1: Line 1:
{{Documentation subpage}}
'''Linkless exists''' checks whether a page exists.  It differs from alternatives such as [[Help:Magic words#Conditional|#ifexist:]] in that the page containing this template is not recorded as linking to or transcluding the page being checked.  This has the advantage of avoiding spurious wikilinks, especially to disambiguation pages which should not have incoming links, but has the disadvantage that the containing page may not be updated automatically if the checked page is created or deleted later.
{{Lua|Module:Excerpt}}
'''Linkless exists''' checks whether a page exists.  It differs from alternatives such as [[Help:Magic words#Conditional|#ifexist:]] and {{tl|Exists}} (deleted) in that the page containing this template is not recorded as linking to or transcluding the page being checked.  This has the advantage of avoiding spurious wikilinks, especially to disambiguation pages which should not have incoming links, 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 8: Line 6:


===TemplateData===
===TemplateData===
{{TemplateDataHeader}}
<templatedata>
<templatedata>
{
{
Line 37: Line 34:
     }
     }
}
}
</templatedata>
</templatedata><noinclude>[[Category:Template documentation]]</noinclude>
 
<includeonly>
[[Category:If-then-else templates]]
</includeonly>

Latest revision as of 18:09, 22 June 2024

Linkless exists checks whether a page exists. It differs from alternatives such as #ifexist: in that the page containing this template is not recorded as linking to or transcluding the page being checked. This has the advantage of avoiding spurious wikilinks, especially to disambiguation pages which should not have incoming links, but has the disadvantage that the containing page may not be updated automatically if the checked page is created or deleted later.

Usage[[edit source]]

The template requires one parameter: the name of the page to be checked. Include a namespace where necessary. There are two other optional parameters: the text to appear if the page is present, and the text to appear if it is absent. By default, these are set to "true" and "", which evaluate as true and false respectively within expressions. {{Linkless exists|Main Page|working|broken}} is an efficient shortcut for {{#if:{{Linkless exists|Main Page}}|working|broken}}.

TemplateData[[edit source]]

Linkless exists checks whether a page exists without recording a wikilink or transclusion

Template parameters

ParameterDescriptionTypeStatus
11

The name of the page to be checked

Stringrequired
22

The text to appear if the page is present

Default
true
Example
page found
Stringoptional
33

The text to appear if the page is absent

Default
(blank string)
Example
page not found
Stringoptional