Jump to content

Template:ESPNcricinfo 2/doc

From Wikipedia, the free encyclopedia

The template ESPNcricinfo 2 is used to generate an external link to a web page at ESPNcricinfo. It should be used on cricket-related pages in the external links section or as a citation using the |access-date= parameter.

Based on its configuration this template would invoke one of the auxiliary templates (ESPNcricinfo 2/scorecard, ESPNcricinfo 2/series, ESPNcricinfo 2/tournament, ESPNcricinfo 2/trophy, ESPNcricinfo 2/player and ESPNcricinfo 2/story).

Usage

[edit]

Using the |id= parameter:

Using the |ref= parameter:

Parameters

[edit]

Full syntax:

{{ESPNcricinfo 2 | FUNCTION | id = ID | ref = REF | title = TITLE | access-date = DATE}}

Function

[edit]

The template invokes the auxiliary template based on the defined function. If not defined, will result in an error message.

ID or Ref

[edit]

The |id= and |ref= parameters are used to define the page being linked to. Please note the following,

  • At least, one of them is compulsory, otherwise would result in an error message.
  • Only one of them should be used at once. If both are used together |ref= will be ignored.
    • scorecard function only supports |id=.
    • series, tournament, trophy and player functions support both parameters.
    • story function only supports |ref=.

Title

[edit]

The title text to be displayed. Defaults to "scorecard" in the scorecard function and {{PAGENAMEBASE}} in other functions while using the |id=, but it won't have a default value while using |ref=.

Access date

[edit]

The |access-date= is used to covert the external link into a citation.

Examples

[edit]
  1. {{ESPNcricinfo 2}}
    Outcome: Please specify a supported function.
  2. {{ESPNcricinfo 2|home}}
    Outcome: Please specify a supported function.
  3. {{ESPNcricinfo 2|id=123}}
    Outcome: Please specify a supported function.

Examples for the scorecard function

[edit]
  • {{ESPNcricinfo 2|scorecard}}
    Outcome: Please specify an ESPNcricinfo match ID using |id=.

Examples for the series function

[edit]
  • {{ESPNcricinfo 2|series}}
    Outcome: Please specify an ESPNcricinfo series ID using |id= or |ref=.

Examples for the tournament function

[edit]
  • {{ESPNcricinfo 2|tournament}}
    Outcome: Please specify an ESPNcricinfo tournament ID using |id= or |ref=.

Examples for the trophy function

[edit]
  • {{ESPNcricinfo 2|trophy}}
    Outcome: Please specify an ESPNcricinfo trophy ID using |id= or |ref=.

Examples for the player function

[edit]
  • {{ESPNcricinfo 2|player}}
    Outcome: {{Cricinfo}} template missing "id" or "ref" parameters and no ID in Wikidata.
  • Using |id= parameter:
    1. {{ESPNcricinfo 2|player|id=311158}}
      Outcome: [4] at ESPNcricinfo
    2. {{ESPNcricinfo 2|player|id=311158|title=ICC Men's T20 World Cup records}}
      Outcome: Ben Stokes at ESPNcricinfo
    3. {{ESPNcricinfo 2|player|id=311158|title=Ben Stokes|access-date=2024-12-20}}
      Outcome: "Ben Stokes". ESPNcricinfo. Retrieved 2024-12-20.
  • Using |ref= parameter:

Examples for the story function

[edit]
  • {{ESPNcricinfo 2|story}}
    Outcome: Please specify a supported function.
  • {{ESPNcricinfo 2|story|ref=icc-world-twenty20-trophy-unveiled-308851}}
    Outcome: This function hasn't been implemented yet.