Template:Year-end single chart/doc

This template is used to cite sources in Wikipedia. It is specifically for recorded musical single releases: singles. A similar template for use when citing sources for musical albums can be found at Template:Year-end album chart; however, for EPs or other releases, it has not yet been developed.

In general, the template expands to produce a table row with the information country, record chart, reference, and final year-end position for the given single on the particular chart. Tables of such information are commonly used in Wikipedia articles on singles, albums, discographies and artists.

This template does not verify any positions or chart appearances. It primarily provides a reference URL believed to be associated with a reliable source for a recognised chart. The reference URL itself is also not checked. Entering an incorrect or alternative spelling of a song title can produce a bad link, for example. Individual editors will need to follow the URLs generated by the template to verify their usefulness before walking away from an edited article.

Usage
This template outputs data suitable for inclusion within a record chart table. It will produce a referenced chart name and a position. It can be used as a part of a larger table, or a series of calls can be used to create a chart. This template does not create the surrounding table markup.

All field names used must be in lowercase.

You can copy a blank version to use. Remember to use the "|" (pipe) character between each field. Please delete any unused fields to avoid clutter in the edit window.

The template has the following syntax:

Fields
The parameters publishdate, accessdate, refname and refgroup are optional.
 * (Chart identifier) (or first parameter, without name): Chart identifier. Must be one of the options listed under Chart ID in the tables of the Support section below. Named as a country or nationality (e.g., Switzerland or Swiss). Some charts allow more than one identifier; the results produced are identical.
 * (Year-end position) (or second parameter, without name): The number you found to be the year-end position achieved by the single on the specific chart.
 * year: Four-digit year indicating the year being reported by the chart (required). Not necessarily the same as the publication date referred to by publishdate.
 * publishdate: Date of publication of the reference generated by the template, in the same format as other dates in citations in the same article. Optional parameter.
 * accessdate: Date that the reference generated by the template was retrieved to determine peak position. Should be in the same format as other dates in citations in the same article. Optional parameter.
 * refname: Enables you to specify a name for the reference generated by the template. If no value is provided for refname the default reference name (in the form ye_Chartid_year, see Output below) will be used. A reference with a name can be reused for claims elsewhere in the article. Optional parameter.
 * refgroup: Enables you to specify a name for the reference group. Optional parameter.

Output
The template's expansion results in two output items:
 * a row of output for a two-cell table row, and
 * a reference

The output row includes the piping character to divide the left cell from the right cell. The left cell includes the country and/or chart name, with wikilinks to the chart article(s), as well as the reference note[n] as if it were enclosed in  tags. The right cell contains the year-end position number, including the code to horizontally center the number in the table cell.

The citation generated by this template will appear in the list in place of  or the  template, like any other references. The reference produced will be given a name in the form "ye_Chartid_year" by default, i.e., if the article uses

then the citation could be used to support other statements on the page using a reference as in

Alternatively, the name can be overridden using the refname parameter, i.e.,

which could then be used as a citation to support other statements on the page using a reference as in

Note that the refname parameter does not require the use of quotation marks, but names with spaces in them will necessitate quotation marks in the name parameter of (for example, you would need to use  if you used spaces in the name).

Examples of output with different parameters
A few examples of template usage and the corresponding output are shown here. {| class="wikitable" style="width: 96%" ! Example no. || Coding (assumed inside a table row) || Output (assumed with
 * style="width: 50%; vertical-align: top;" |
 * style="vertical-align: top;" |


 * style="vertical-align: top;" |
 * style="vertical-align: top;" |
 * }