Template:Link if exists: Difference between revisions
Appearance
Content deleted Content added
←Created page with '<includeonly>{{#if:{{{prefix|}}}|{{#ifexists:{{{prefix}}}:{{{1}}}|[[:{{{prefix}}}:{{{1}}}]]|{{{1}}}}}|{{#if:{{{nsp|}}}|{{#ifexists:{{{nsp}}}:{{{1}}}|[[:{{{nsp}}}:{{…' |
No edit summary |
||
Line 1: | Line 1: | ||
<includeonly>{{#if:{{{prefix|}}}|{{# |
<includeonly>{{#if:{{{prefix|}}}|{{#ifexist:{{{prefix}}}:{{{1}}}|[[:{{{prefix}}}:{{{1}}}]]|{{{1}}}}}|{{#if:{{{nsp|}}}|{{#ifexist:{{{nsp}}}:{{{1}}}|[[:{{{nsp}}}:{{{1}}}|{{{1}}}]]|{{{1}}}}}|{{#ifexist:{{{1}}}|[[{{{1}}}]]|{{{1}}}}}}}}}</includeonly><noinclude>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. |
||
[[Category:Internal link templates|Linkif]]</noinclude> |
[[Category:Internal link templates|Linkif]]</noinclude> |
Revision as of 14:06, 17 April 2009
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.