Template:Linkexist/doc
![]() | This is a documentation subpage for Template:Linkexist. It may contain usage information, categories and other content that is not part of the original template page. |
NOTE: This template has confusing behaviour, poor incomplete documentation, and produces invalid wikitext in some cases.
The template is a way of creating optional links based on whether the target exists or not.
It is presently used in {{culture of region}}, as that template uses the logic in question so many times that transcluding it every time would lead to cluttered code.
Usage
<syntaxhighlight lang="wikitext"> linktext </syntaxhighlight>
If alternative
is specified, the template will link to that title. Otherwise, the template will link to page
if it exists. linktext
, if specified, will be the label for the link (or unlinked output).
Examples
<syntaxhighlight lang="wikitext">[[History of Ghana|]]</syntaxhighlight>
[[History of Ghana|]]
<syntaxhighlight lang="wikitext">History</syntaxhighlight>
<syntaxhighlight lang="wikitext">History</syntaxhighlight>