Template:Link if exists: Difference between revisions
Appearance
Content deleted Content added
m Changed protection level for "Template:Link if exists": high-risk template with 4000+ transclusions ([Edit=Require template editor access] (indefinite) [Move=Require template editor access] (indefinite)) |
indented for sanity preservation reasons |
||
Line 1: | Line 1: | ||
<!-- Indented for your sanity. |
|||
{{#if:{{{prefix|}}}|{{#ifexist:{{{prefix}}}:{{{1}}}|[[:{{{prefix}}}:{{{1}}}]]|{{{1}}}}}|{{#if:{{{nsp|}}}|{{#ifexist:{{{nsp}}}:{{{1}}}|[[:{{{nsp}}}:{{{1}}}|{{{1}}}]]|{{{1}}}}}|{{#ifexist:{{{1}}}|[[{{{1}}}]]|{{{1}}}}}}}}}<noinclude> |
|||
-->{{#if:{{{prefix|}}}<!-- |
|||
-->|{{#ifexist:{{{prefix}}}:{{{1}}}<!-- |
|||
-->|[[:{{{prefix}}}:{{{1}}}]]<!-- |
|||
-->|{{{1}}}<!-- |
|||
-->}}<!-- |
|||
-->|{{#if:{{{nsp|}}}<!-- |
|||
-->|{{#ifexist:{{{nsp}}}:{{{1}}}<!-- |
|||
-->|[[:{{{nsp}}}:{{{1}}}|{{{1}}}]]<!-- |
|||
-->|{{{1}}}<!-- |
|||
-->}}<!-- |
|||
-->|{{#ifexist:{{{1}}}<!-- |
|||
-->|[[{{{1}}}]]<!-- |
|||
-->|{{{1}}}<!-- |
|||
-->}}<!-- |
|||
-->}}<!-- |
|||
-->}}<noinclude> |
|||
{{Documentation}} |
{{Documentation}} |
||
</noinclude> |
</noinclude> |
Latest revision as of 15:48, 30 January 2024
{{{1}}}
This template is used on approximately 73,000 pages and changes may be widely noticed. Test changes in the template's /sandbox or /testcases subpages, or in your own user subpage. Consider discussing changes on the talk page before implementing them. |
Usage
For use as a subtemplate of other templates. Displays the first parameter, linked if an article exists, otherwise unlinked. You can also define a parameter nsp, for the namespace to try to link to (e.g. "nsp=Category"). Use prefix instead of nsp if the prefix is also to be displayed if a link is found.
See also
- {{Link if not current}}
- {{LinkCatIfExists}}
- {{LinkCatIfExists2}}
- {{Linked}} – links if not already linked
- {{Link if exists redirect}}