Template:Alternate links

From Wikipedia, the free encyclopedia

This template employs intricate features of template syntax.
Please do not alter it unless you are certain to understand its setup and parser functions and are ready to repair/revert all collateral damage if results are unexpected.
Any experiments should be conducted and all improvements tested in either the template sandbox or your user space before applying anything here.

This template will allow you to provide multiple alternate choices for a link and will display the first one that exists. This is most useful for linking to topics that tend to have annual pages where the annual page may or may not exist.

For example, if I want to link to an the article about the 2010 Richmond Spiders football team that may or may not exist, I would make this call:

{{Alternate links|2010 Richmond Spiders football team|Richmond Spiders football|Richmond Spiders|University of Richmond|title=Richmond|alt=Richmond}}

This would yield: Richmond

Important - whitespace cannot be included or it will be added to the wiki link and it will not function properly.

[edit] Parameters

parameter meaning
alt If none of the requested titles exist, display this text instead. If this is left blank, then nothing will be displayed at all.
title If any of the requested articles exist, display this title for the article. If this is left blank, then the article title will be displayed
1, 2, 3, ... Articles to attempt to display

[edit] Examples

{{Alternate links|2007 Virginia Tech Hokies football team|Virginia Tech Hokies football|Virginia Tech Hokies|Virginia Tech|title=VT}} VT
{{Alternate links|Some unreal article|Main page|title=is there a main?}} is there a main?
{{Alternate links|George Bush|Bill Clinton|VPI||title=test}} test
{{Alternate links|Virginia Techx|alt=''no such article''}} no such article

[edit] See also