Difference between revisions of "Template:Linkexist/doc"
Jump to navigation
Jump to search
imported>Thumperward (explain) |
imported>علیرضا m |
||
Line 12: | Line 12: | ||
</pre> | </pre> | ||
− | If <code>alternative</code> is specified, the template will link to that article. Otherwise, the | + | If <code>alternative</code> is specified, the template will link to that article. Otherwise, the template will link to <code>page</code> if it exists. <code>linktext</code>, if specified, will be the label for the link (or unlinked output). |
== Examples == | == Examples == |
Revision as of 06:41, 13 May 2014
![]() | This is a documentation subpage for Template:Linkexist. It contains usage information, categories and other content that is not part of the original template page. |
This template is a simple 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
{{listexist|page|linktext|alternative}}
If alternative
is specified, the template will link to that article. Otherwise, the template will link to page
if it exists. linktext
, if specified, will be the label for the link (or unlinked output).
Examples
{{linkexist|History of Ghana}}
{{linkexist|History of Ghana|History}}
{{linkexist|History of Ghana|History|Culture of Ghana}}