Difference between revisions of "Template:Film date/doc"

From blackwiki
Jump to navigation Jump to search
(make examples consistent with parent template, tidy)
imported>BrownHairedGirl
(→‎Tracking: add TOTAL by-release-date)
 
(24 intermediate revisions by 17 users not shown)
Line 1: Line 1:
 
{{Documentation subpage}}
 
{{Documentation subpage}}
 +
{{High-use|86433}}
 
<!-- EDIT TEMPLATE DOCUMENTATION BELOW THIS LINE -->
 
<!-- EDIT TEMPLATE DOCUMENTATION BELOW THIS LINE -->
 +
 +
==Purpose==
 +
This template has two functions:
 +
# To provide correct formatting of film release dates and their locations within {{tl|Infobox film}}. A citation for each date/location may also be supplied.
 +
# To automatically categorize films according to their first release date.
  
 
==Usage==
 
==Usage==
This template ({{[[Template:Film date|Film date]]}}) returns auto formatting for use in the "released" parameter of {{[[Template:Infobox film|Infobox film]]}}. The template applies  [[:Category:Upcoming films]] to films unreleased and replaces it with <code><nowiki>[[Category:YYYY films]]</nowiki></code>, where YYYY is the year of first release, on the day of release. It also calls {{Tl|Start date}} for the first release date.
+
This template is intended to supply a result to the {{para|released}} parameter of {{tl|Infobox film}}.
 +
 
 +
The template adds <code><nowiki>Category:YYYY films</nowiki></code> where YYYY is the year of first release, as well as <code>[[:Category:Upcoming films]]</code> for films that have not reached their first release yet. Please note that <code><nowiki>Category:YYYY films</nowiki></code> will only be added if the category exists, and that if only the year is included as the release date, the film is considered to be "upcoming" during that entire year.
 +
 
 +
The television equivalents of these categories (<code><nowiki>Category:YYYY television films</nowiki></code> and <code>[[:Category:Upcoming television films]]</code>) are used when the {{para|TV}} parameter is set for use on television film articles.
  
 
==Syntax==
 
==Syntax==
*<nowiki>{{Film date|year|month|day|location}}</nowiki>
+
This template allows up to five release dates/locations, but normally no more than two are needed. Please see [[WP:FILMRELEASE]] for a full explanation.
 +
 
 +
===One release date only===
 +
*<code><nowiki>{{Film date|year|month|day|location|ref1=<ref name="xxxxx" />}}</nowiki></code>
 +
 
 +
If no <code>location</code> is specified, <code>month</code> and <code>day</code> may be omitted. If <code>location</code> is specified, then <code>month</code> and <code>day</code> ''must'' be supplied, though they may be left blank or empty if not known; '''<code>ref1=</code>''' is an optional parameter allowing a named reference ("xxxxx") to be used to verify the date/location of the release.
 +
 
 +
===More than one release date===
 +
*<code><nowiki>{{Film date|year1|month1|day1|location1|ref1=<ref name="xxxxx" />|year2|month2|day2|location2|ref2=<ref name="yyyy" />}}</nowiki></code> and similarly for up to five dates/locations.
 +
 
 +
In this case, all the <code>year</code>, <code>month</code>, <code>day</code> and <code>location</code> parameters, except the last, must be supplied, but as before, <code>month</code> and <code>day</code> may be left empty or blank if not known. Note that '''<code>ref1=</code>''', '''<code>ref2=</code>''', etc. are optional named parameters, and either may be omitted without affecting the other parameters.
 +
 
 +
===Examples===
 +
<code><nowiki>{{Film date|1993}}</nowiki></code> returns:<br />{{Film date|1993}}
 +
 
 +
<code><nowiki>{{Film date|1993|02}}</nowiki></code> returns:<br />{{Film date|1993|02}}
 +
 
 +
<code><nowiki>{{Film date|1993|02|24}}</nowiki></code> returns:<br />{{Film date|1993|02|24}}
  
This template allows up to five dates. No parameters are required. Please, however, indicate the year of release. Please see [[WP:FILMRELEASE]] for use of locations.
+
<code><nowiki>{{Film date|1993|February|24}}</nowiki></code> returns:<br />{{Film date|1993|February|24}}
Examples:
 
  
*<nowiki>{{Film date|1993}}</nowiki> returns:<br />{{Film date|1993}}
+
<code><nowiki>{{Film date|1993|02|24||2008|03}}</nowiki></code> returns:<br />{{Film date|1993|02|24||2008|03}}
*<nowiki>{{Film date|1993|02}}</nowiki> returns:<br />{{Film date|1993|02}}
 
*<nowiki>{{Film date|1993|02|24}}</nowiki> returns:<br />{{Film date|1993|02|24}}
 
*<nowiki>{{Film date|1993|February|24}}</nowiki> returns:<br />{{Film date|1993|February|24}}
 
*<nowiki>{{Film date|1993|02|24||2008|03}}</nowiki> returns:<br />{{Film date|1993|02|24||2008|03}}
 
*<nowiki>{{Film date|1993|02|24||2008|||Latvia}}</nowiki> returns:<br />{{Film date|1993|02|24||2008|||Latvia}}
 
*<nowiki>{{Film date|1993|02|24||2008|03|23}}</nowiki> returns:<br />{{Film date|1993|02|24||2008|03|23}}
 
  
An optional parameter, "'''df'''", can be set to "y" or "yes" to display the day before the month. Default is month before day.
+
<code><nowiki>{{Film date|1993|02|24|Latvia}}</nowiki></code> returns:<br />{{Film date|1993|02|24|Latvia}}
  
Examples:
+
<code><nowiki>{{Film date|1993|02|24||2008|03|23}}</nowiki></code> returns:<br />{{Film date|1993|02|24||2008|03|23}}
  
*<nowiki>{{Film date|1993|02|24|df=y}}</nowiki> returns:<br />{{Film date|1993|02|24|df=y}}
+
===Optional parameters===
*<nowiki>{{Film date|1993|02|24||2008|||Latvia|df=y}}</nowiki> returns:<br />{{Film date|1993|02|24||2008|||Latvia|df=y}}
+
* '''df''' can be set to "y" or "yes" to display the day before the month. Default is month before day.
  
An optional parameter, "'''fy'''", can be set to override the automatic category. For example:
+
<code><nowiki>{{Film date|1993|02|24|df=y}}</nowiki></code> returns:<br />{{Film date|1993|02|24|df=y}}
*<nowiki>{{Film date|1993|02|24||2008|03|23}}</nowiki> uses the category {{cl|1993 films}}
 
*<nowiki>{{Film date|1993|02|24||2008|03|23|fy=2008}}</nowiki> uses the category {{cl|2008 films}}.
 
  
An optional parameter, "'''TV'''", is to be used for television films. It sorts films into <code><nowiki>[[Category:YYYY television films]]</nowiki></code> in place of <code><nowiki>[[Category:YYYY films]]</nowiki></code>.
+
<code><nowiki>{{Film date|1993|02|24|Latvia|df=y}}</nowiki></code> returns:<br />{{Film date|1993|02|24|Latvia|df=y}}
 +
 
 +
 
 +
* '''fy''' can be set to override the automatic category. For example:
 +
 
 +
<code><nowiki>{{Film date|1993|02|24||2008|03|23}}</nowiki></code> uses the category {{cl|1993 films}}
 +
 
 +
<code><nowiki>{{Film date|1993|02|24||2008|03|23|fy=2008}}</nowiki></code> uses the category {{cl|2008 films}}.
 +
 
 +
 
 +
* '''TV''' is to be used for television films. It sorts films into <code><nowiki>[[Category:YYYY television films]]</nowiki></code> in place of <code><nowiki>[[Category:YYYY films]]</nowiki></code>. Set <code>TV=y</code> or <code>TV=yes</code> to do this.
 +
 
 +
 
 +
* '''ref1''', '''ref2''', '''ref3''', '''ref4''', '''ref5''' are used to supply named references. See above for detail.
 +
 
 +
==Technical notes==
 +
Do not use any of the following markup in front of this template: <code>: * #</code>. Doing so will cause HTML errors. See [[MOS:INDENT]] for more guidance.
 +
 
 +
This template uses {{tl|Start date}} to handle the hard work of date formatting, and {{tl|Plainlist}} to format list items as recommended for use within infoboxes.
 +
 
 +
; {{nowiki template demo|output=nowiki+|code=<nowiki>{{Film date|2001|1|28|location1|2002|2|28|location2}}</nowiki>}}
  
 
==Redirects==
 
==Redirects==
 
*{{[[Template:Fd|Fd]]}}
 
*{{[[Template:Fd|Fd]]}}
 
*{{[[Template:Filmdate|Filmdate]]}}
 
*{{[[Template:Filmdate|Filmdate]]}}
 +
 +
== Tracking ==
 +
 +
Use of this template is tracked though the following categories:
 +
 +
; Tracking use of the {{para|fy}} parameter, which overrides the automatic categorisation by year
 +
* [[:Category:Template film date with category override]] (population {{PAGESINCATEGORY:Template film date with category override}})
 +
 +
; Tracking by number of release dates:
 +
* [[:Category:Template film date with 1 release date]] (population {{PAGESINCATEGORY:Template film date with 1 release date}})
 +
* [[:Category:Template film date with 2 release dates]] (population {{PAGESINCATEGORY:Template film date with 2 release dates}})
 +
* [[:Category:Template film date with 3 release dates]] (population {{PAGESINCATEGORY:Template film date with 3 release dates}})
 +
* [[:Category:Template film date with 4 release dates]] (population {{PAGESINCATEGORY:Template film date with 4 release dates}})
 +
* [[:Category:Template film date with 5 release dates]] (population {{PAGESINCATEGORY:Template film date with 5 release dates}})
 +
: TOTAL by-release-date: '''{{formatnum:{{#expr: <!--
 +
--> {{PAGESINCATEGORY:Template film date with 1 release date|R}} +<!--
 +
--> {{PAGESINCATEGORY:Template film date with 2 release dates|R}} +<!--
 +
--> {{PAGESINCATEGORY:Template film date with 3 release dates|R}} +<!--
 +
--> {{PAGESINCATEGORY:Template film date with 4 release dates|R}} +<!--
 +
--> {{PAGESINCATEGORY:Template film date with 5 release dates|R}}<!--
 +
-->}}<!--
 +
-->}}'''
 +
<small>{{Purge page|''Purge page to update totals''}}</small>
 +
 +
Note that these categories were created on 3 April 2020, and may take a few days to fully populate.
  
 
==See also==
 
==See also==
Line 41: Line 104:
 
*{{[[Template:Small|Small]]}}
 
*{{[[Template:Small|Small]]}}
  
<!-- categories and interwikis -->
+
<includeonly>{{sandbox other||
 
[[Category:Film templates]]
 
[[Category:Film templates]]
 
+
}}</includeonly>
[[ar:قالب:تاريخ فيلم]]
 
[[zh:Template:Film date]]
 
[[ja:Template:Film date]]
 
[[hy:Կաղապար:Film date]]
 
[[ta:வார்ப்புரு:Film date]]
 
[[tr:Şablon:Film tarihi]]
 

Latest revision as of 02:28, 3 April 2020

Purpose

This template has two functions:

  1. To provide correct formatting of film release dates and their locations within {{Infobox film}}. A citation for each date/location may also be supplied.
  2. To automatically categorize films according to their first release date.

Usage

This template is intended to supply a result to the |released= parameter of {{Infobox film}}.

The template adds Category:YYYY films where YYYY is the year of first release, as well as Category:Upcoming films for films that have not reached their first release yet. Please note that Category:YYYY films will only be added if the category exists, and that if only the year is included as the release date, the film is considered to be "upcoming" during that entire year.

The television equivalents of these categories (Category:YYYY television films and Category:Upcoming television films) are used when the |TV= parameter is set for use on television film articles.

Syntax

This template allows up to five release dates/locations, but normally no more than two are needed. Please see WP:FILMRELEASE for a full explanation.

One release date only

  • {{Film date|year|month|day|location|ref1=<ref name="xxxxx" />}}

If no location is specified, month and day may be omitted. If location is specified, then month and day must be supplied, though they may be left blank or empty if not known; ref1= is an optional parameter allowing a named reference ("xxxxx") to be used to verify the date/location of the release.

More than one release date

  • {{Film date|year1|month1|day1|location1|ref1=<ref name="xxxxx" />|year2|month2|day2|location2|ref2=<ref name="yyyy" />}} and similarly for up to five dates/locations.

In this case, all the year, month, day and location parameters, except the last, must be supplied, but as before, month and day may be left empty or blank if not known. Note that ref1=, ref2=, etc. are optional named parameters, and either may be omitted without affecting the other parameters.

Examples

{{Film date|1993}} returns:

  • 1993 (1993)

{{Film date|1993|02}} returns:

  • February 1993 (1993-02)

{{Film date|1993|02|24}} returns:

  • February 24, 1993 (1993-02-24)

{{Film date|1993|February|24}} returns:

  • February 24, 1993 (1993-February-24)

{{Film date|1993|02|24||2008|03}} returns:

  • February 24, 1993 (1993-02-24)
  • March 2008 (2008-03)

{{Film date|1993|02|24|Latvia}} returns:

  • February 24, 1993 (1993-02-24) (Latvia)

{{Film date|1993|02|24||2008|03|23}} returns:

  • February 24, 1993 (1993-02-24)
  • March 23, 2008 (2008-03-23)

Optional parameters

  • df can be set to "y" or "yes" to display the day before the month. Default is month before day.

{{Film date|1993|02|24|df=y}} returns:

  • 24 February 1993 (1993-02-24)

{{Film date|1993|02|24|Latvia|df=y}} returns:

  • 24 February 1993 (1993-02-24) (Latvia)


  • fy can be set to override the automatic category. For example:

{{Film date|1993|02|24||2008|03|23}} uses the category Category:1993 films

{{Film date|1993|02|24||2008|03|23|fy=2008}} uses the category Category:2008 films.


  • TV is to be used for television films. It sorts films into [[Category:YYYY television films]] in place of [[Category:YYYY films]]. Set TV=y or TV=yes to do this.


  • ref1, ref2, ref3, ref4, ref5 are used to supply named references. See above for detail.

Technical notes

Do not use any of the following markup in front of this template: : * #. Doing so will cause HTML errors. See MOS:INDENT for more guidance.

This template uses {{Start date}} to handle the hard work of date formatting, and {{Plainlist}} to format list items as recommended for use within infoboxes.

Template:Nowiki template demo

Redirects

Tracking

Use of this template is tracked though the following categories:

Tracking use of the |fy= parameter, which overrides the automatic categorisation by year
Tracking by number of release dates
TOTAL by-release-date: 0

Purge page to update totals

Note that these categories were created on 3 April 2020, and may take a few days to fully populate.

See also