Difference between revisions of "Template:Cfb link"

From blackwiki
Jump to navigation Jump to search
imported>DeFaultRyan
(allow displaying link name instead of title)
imported>Dispenser
(WP:DOC; indenting logic)
Line 1: Line 1:
<includeonly>{{#ifexist:{{{year}}} {{{team}}} football team|[[{{{year}}} {{{team}}} football team{{#if:{{{title|}}}|{{!}}{{{title|}}}|}}]]{{#ifeq:{{{cat|}}}|no| |[[Category:Excessive uses of cfb link]]}}|<noinclude><!--
+
{{#ifexist:{{{year}}} {{{team}}} football team
--></noinclude>{{#ifexist:{{{team}}} football|[[{{{team}}} football{{#if:{{{title|}}}|{{!}}{{{title|}}}|}}]]|<noinclude><!--
+
|[[{{{year}}} {{{team}}} football team{{#if:{{{title|}}}|{{!}}{{{title}}}|}}]]{{#ifeq:{{{cat|}}}|no
--></noinclude>{{#ifexist:{{{team}}}|[[{{{team}}}{{#if:{{{title|}}}|{{!}}{{{title|}}}|}}]]|<noinclude><!--
+
  |
--></noinclude>[[{{{school}}}{{#if:{{{title|}}}|{{!}}{{{title|}}}|}}]]<noinclude><!--
+
  |[[Category:Excessive uses of cfb link]]
--></noinclude>}}}}}}</includeonly><noinclude>{{esoteric}}{{High-use| 2,000+ }}
+
  }}
 +
|{{#ifexist:{{{team}}} football
 +
  |[[{{{team}}} football{{#if:{{{title|}}}|{{!}}{{{title}}}|}}]]
 +
  |{{#ifexist:{{{team}}}
 +
    |[[{{{team}}}{{#if:{{{title|}}}|{{!}}{{{title}}}|}}]]
 +
    |[[{{{school}}}{{#if:{{{title|}}}|{{!}}{{{title}}}|}}]]
 +
    }}
 +
  }}
 +
}}<noinclude>
  
This template will allow you to link to a [[college football]] team page that may not yet exist.  It will display the best available link.
+
{{Documentation}}
 
+
<!-- PLEASE ADD THIS TEMPLATE'S CATEGORIES AND INTERWIKIS TO THE /doc SUBPAGE, THANKS -->
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>{{cfb link|year=2010|team=Richmond Spiders|school=University of Richmond|title=Richmond}}</nowiki></pre>
 
 
 
This would yield: {{cfb link|year=2010|team=Richmond Spiders|school=University of Richmond|title=Richmond}}
 
 
 
'''Important''' - whitespace cannot be included or it will be added to the wiki link and it will not function properly.
 
 
 
==Use of this template==
 
 
 
Due to restrictions on use of #ifexist, it is important to not use this template if it isn't needed.  In other words, if the article you really want to link to already exists, just link to it.  [[:Category:Excessive uses of cfb link]] contains a list of occasions where this template is used and doesn't need to be.
 
 
 
==Naming conventions==
 
 
 
In order for this template to work, articles MUST be named correctly.  The football naming convention is:
 
 
 
* Season articles: Season SchoolShortName TeamName football team, eg, [[2007 Virginia Tech Hokies football team]] or [[2004 Auburn Tigers football team]]
 
* Football team articles: SchoolShortName TeamName football, eg, [[Virginia Tech Hokies football]], [[Florida State Seminoles football]]
 
* Athletics department articles: SchoolShortName TeamName, eg, [[North Carolina Tar Heels]], [[Virginia Cavaliers]]
 
 
 
==Parameters==
 
 
 
{| class="wikitable"
 
|-
 
! parameter
 
! meaning
 
|-
 
| '''year''' ''(optional)''
 
| Supply a year if you want to link to the yearly page, eg, 2007 Virginia Tech Hokies football team
 
|-
 
| '''team'''
 
| The athletics program article for this school, eg, Virginia Tech Hokies, Wake Forest Demon Deacons, Miami Hurricanes, etc
 
|-
 
| '''school'''
 
| The main article for this school, eg, Florida State University, University of Virginia, etc
 
|-
 
| '''title'''
 
| The display name for this link.  Usually, this will be the common name for the school (without "university"), like Duke, Florida State, Virginia Tech, etc. If left blank, the link will be non-piped, i.e., it will display the name of the article linked to.
 
|}
 
 
 
==Examples==
 
{| class="wikitable"
 
|-
 
| <nowiki>{{cfb link|year=2007|team=Virginia Tech Hokies|school=Virginia Polytechnic Institute and State University|title=Virginia Tech}}</nowiki>
 
| {{cfb link|year=2007|team=Virginia Tech Hokies|school=Virginia Polytechnic Institute and State University|title=Virginia Tech}}
 
|-
 
| <nowiki>{{cfb link|year=2006|team=Virginia Tech Hokies|school=Virginia Polytechnic Institute and State University|title=Virginia Tech}}</nowiki>
 
| {{cfb link|year=2006|team=Virginia Tech Hokies|school=Virginia Polytechnic Institute and State University|title=Virginia Tech}}
 
|-
 
| <nowiki>{{cfb link|team=Florida State Seminoles|school=Florida State University|title=FSU}}</nowiki>
 
| {{cfb link|team=Florida State Seminoles|school=Florida State University|title=FSU}}
 
|-
 
| <nowiki>{{cfb link|year=2008|team=Utah Utes}}</nowiki>
 
| {{cfb link|year=2008|team=Utah Utes}}
 
|}
 
 
 
==See also==
 
* {{tl|alternate links}}
 
* {{tl|cbb link}}
 
 
 
[[Category:Internal link templates]]
 
[[Category:NCAA individual season templates]]
 
[[Category:American college football templates]]
 
 
</noinclude>
 
</noinclude>

Revision as of 21:21, 19 October 2009

[[{{{school}}}]]

50px Template documentation[view] [edit] [history] [purge]

{{Cfb link}} allows linking to a college football team page that may not yet exist. It will display the best available link.

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

{{cfb link|year=2020|team=Richmond Spiders|school=University of Richmond|title=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.

Use of this template

Due to restrictions on use of #ifexist, it is important to not use this template if it isn't needed. In other words, if the link already exists, just link to it. Category:Excessive uses of cfb link contains a list of occasions where this template is used and doesn't need to be. A bot will soon replace this template with the specific link on articles in that category.

Please do not use this template on disambiguation pages (dab pages) due to requirements for links on dab pages.

Naming conventions

In order for this template to work, articles MUST be named correctly. The football naming convention is:

Parameters

parameter meaning
year (optional) Supply a year if you want to link to the yearly page, e.g., 2007 Virginia Tech Hokies football team
team The athletics program article for this school, e.g., Virginia Tech Hokies, Wake Forest Demon Deacons, Miami Hurricanes
school The main article for this school, e.g., Florida State University, University of Virginia
title (optional) The display name for this link. Usually, this will be the common name for the school (without "university"), like Duke, Florida State, Virginia Tech, etc. If left blank, the link will be non-piped, i.e., it will display the name of the article linked to.

Examples

{{cfb link|year=2099|team=Virginia Tech Hokies|school=Virginia Polytechnic Institute and State University|title=Virginia Tech}} Virginia Tech
{{cfb link|year=2006|team=Virginia Tech Hokies|school=Virginia Polytechnic Institute and State University|title=Virginia Tech}} Virginia Tech
{{cfb link|team=Florida State Seminoles|school=Florida State University|title=FSU}} FSU
{{cfb link|year=2008|team=Utah Utes}} [[{{{school}}}]]

TemplateData

This is the TemplateData documentation for this template used by VisualEditor and other tools; see the monthly parameter usage report for this template.

TemplateData for Cfb link

This template allows linking to a college football team page that may not yet exist. It will display the best available link. Please do not use this template unless absolutely necessary, due to restrictions on use of #ifexist. In other words, if the link already exists, just link to it.

Template parameters

This template prefers inline formatting of parameters.

ParameterDescriptionTypeStatus
Yearyear

Can be used to attempt a link to the yearly page of a team

Example
2035
Numberoptional
Teamteam

The athletics program article for this school

Example
Virginia Tech Hokies
Pagerequired
Schoolschool

The main article for this school

Example
Virginia Polytechnic Institute and State University
Pagerequired
Titletitle

The display name for this link. Usually, this will be the common name for the school (without "university")

Example
Virginia Tech
Stringoptional

See also