Difference between revisions of "Template:Alternative links"
Jump to navigation
Jump to search
blackwiki>Mclay1 m (moved Template:Alternate links to Template:Alternative links: per WP:COMMONALITY) |
blackwiki>DH85868993 (update template name in examples following page move (over 3.5 years ago!)) |
||
| Line 11: | Line 11: | ||
--></noinclude>{{{alt}}}}}}}}}}}}}}}}}}}}}}}</includeonly><noinclude>{{esoteric}} | --></noinclude>{{{alt}}}}}}}}}}}}}}}}}}}}}}}</includeonly><noinclude>{{esoteric}} | ||
| − | This template will allow you to provide multiple | + | This template will allow you to provide multiple alternative 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 the article about the 2010 Richmond Spiders football team that may or may not exist, I would make this call: | For example, if I want to link to the article about the 2010 Richmond Spiders football team that may or may not exist, I would make this call: | ||
| − | <pre><nowiki>{{ | + | <pre><nowiki>{{Alternative links|2010 Richmond Spiders football team|Richmond Spiders football|Richmond Spiders|University of Richmond|title=Richmond|alt=Richmond}}</nowiki></pre> |
| − | This would yield: {{ | + | This would yield: {{Alternative links|2010 Richmond Spiders football team|Richmond Spiders football|Richmond Spiders|University of Richmond|title=Richmond|alt=Richmond}} |
'''Important''' - whitespace cannot be included or it will be added to the wiki link and it will not function properly. | '''Important''' - whitespace cannot be included or it will be added to the wiki link and it will not function properly. | ||
| Line 41: | Line 41: | ||
{| class="wikitable" | {| class="wikitable" | ||
|- | |- | ||
| − | | <nowiki>{{ | + | | <nowiki>{{Alternative links|2007 Virginia Tech Hokies football team|Virginia Tech Hokies football|Virginia Tech Hokies|Virginia Tech|title=VT}}</nowiki> |
| − | | {{ | + | | {{Alternative links|2007 Virginia Tech Hokies football team|Virginia Tech Hokies football|Virginia Tech Hokies|Virginia Tech|title=VT}} |
|- | |- | ||
| − | | <nowiki>{{ | + | | <nowiki>{{Alternative links|Some unreal article|Main page|title=is there a main?}}</nowiki> |
| − | | {{ | + | | {{Alternative links|Some unreal article|Main page|title=is there a main?}} |
|- | |- | ||
| − | | <nowiki>{{ | + | | <nowiki>{{Alternative links|George Bush|Bill Clinton|VPI||title=test}}</nowiki> |
| − | | {{ | + | | {{Alternative links|George Bush|Bill Clinton|VPI||title=test}} |
|- | |- | ||
| − | | <nowiki>{{ | + | | <nowiki>{{Alternative links|Virginia Techx|alt=''no such article''}}</nowiki> |
| − | | {{ | + | | {{Alternative links|Virginia Techx|alt=''no such article''}} |
|} | |} | ||
Revision as of 07:34, 29 August 2014
| 40x40px | This template employs intricate features of template syntax.
You are encouraged to familiarise yourself with its setup and parser functions before editing the template. If your edit causes unexpected problems, please undo it quickly, as this template may appear on a large number of pages. You can conduct experiments, and should test all major changes, in either this template's sandbox, the general template sandbox, or your user space before changing anything here. |
This template will allow you to provide multiple alternative 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 the article about the 2010 Richmond Spiders football team that may or may not exist, I would make this call:
{{Alternative 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.
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 |
Examples
| {{Alternative links|2007 Virginia Tech Hokies football team|Virginia Tech Hokies football|Virginia Tech Hokies|Virginia Tech|title=VT}} | {{{alt}}} |
| {{Alternative links|Some unreal article|Main page|title=is there a main?}} | {{{alt}}} |
| {{Alternative links|George Bush|Bill Clinton|VPI||title=test}} | {{{alt}}} |
| {{Alternative links|Virginia Techx|alt=''no such article''}} | no such article |
See also
- {{cfb link}}