Template:As of/doc: Difference between revisions

Jump to navigation Jump to search
m
update /doc
>Tomoneill
(includeonly)
 
>Paine Ellsworth
m (update /doc)
Line 1: Line 1:
{{Documentation subpage}}
{{Documentation subpage}}
''This should not be confused with [[Template:As of?]], which redirects to [[Template:When]].''
{{tc}}
<!-- EDIT TEMPLATE DOCUMENTATION BELOW THIS LINE -->
<!-- EDIT TEMPLATE DOCUMENTATION BELOW THIS LINE -->
{{distinguish|text=[[Template:As of?]]}}
{{high-use| 60702 }}


The template {{tlx|as of}} is used to mark potentially dated statements, and will add an article to the appropriate {{w|Wikipedia:HIDDENCAT|hidden}} sub-category of [[:Category:All articles containing potentially dated statements]]. This allows editors to catalog statements that may become dated over time. The date used for a given statement should be the current date (for currently valid statements) or the date on which the cited reference was produced (for example, when using census data). It also includes the {{w|WP:ISO 8601|ISO 8601}} format needed by {{w|hAtom}} (<code>class="updated"</code>) and {{w|hCalendar}} (<code>class="dtstart"</code>) {{w|microformat}}s through use of the {{tlx|start date}} template. Unlike the {{tlx|update after}} template, {{tlx|as of}} does not require the editor to give a full date. This template should '''not''' be {{w|Wikipedia:Substitution|substituted}}.
==Usage==
The template {{tl|As of}} is used to mark potentially dated statements, and will add an article to the appropriate [[WP:HIDDENCAT|hidden]] sub-category of [[:Category:Articles containing potentially dated statements]]. This allows editors to catalogue statements that may become outdated over time. The date used for a given statement should be the date of the most recent [[WP:RS|reliable source]] (for currently valid statements), or the date on which the cited reference was produced (for example, when using census data). It should not be used for future dates (use {{tl|update after}} instead). This template should '''not''' be [[Wikipedia:Substitution|substituted]].


This template generates a hyperlink in text where it is used.
'''Notes:'''
* '''This template MUST NOT be used in infoboxes that emit a [[Wikipedia:WikiProject Microformats|microformat]], as its emitted date markup will conflict with that. '''
* '''This template is not necessary within quotations, and use of the template in such cases should be avoided.'''


==Syntax==
This template does not generate a visible hyperlink in text where it is used.
The template can be used in the following forms:


:{{tld|As of|year}}
===Usage guidelines===
:{{tld|As of|year|month}}
{{main|Wikipedia:As of}}
:{{tld|As of|year|month|day}}  
{{#section-h:Wikipedia:As of|Usage guidelines}}
Using this template with values such as {{tlx|As of|now}} or variables such as {{tlx|As of|<nowiki>{{CURRENTYEAR}}</nowiki>}} is a [[MOS:RELTIME|relative time reference]] and the equivalent to using "currently", which is generally against the [[Wikipedia:As of#Precise language|precise language]] guideline.


Generally, specifying just the year or the year and month is preferred. If you specify a day, you will likely find that a category for dated information from that particular date does not yet exist, and that category name will appear in red at the bottom of the article, along with [[:Category:Articles with invalid date parameter in template]]. In that case, you should follow the steps described under the [[#Red link category appears|Red link category appears]] heading below.
==Syntax==
The template can be used in the following forms, with numeric date information:


Please do not use <code><nowiki>{{As of|{{CURRENTYEAR}}|{{CURRENTMONTH}}}}</nowiki></code> or similar: that defeats the point of the template.
:<code><nowiki>{{As of|</nowiki>{{var|year}}<nowiki>}}</nowiki></code>
:<code><nowiki>{{As of|</nowiki>{{var|year}}{{!}}{{var|month}}<nowiki>}}</nowiki></code>
:<code><nowiki>{{As of|</nowiki>{{var|year}}{{!}}{{var|month}}{{!}}{{var|day}}<nowiki>}}</nowiki></code>


Several additional named parameters can also be used (see below).
Leading zeroes are optional.


==Parameters==
Please do not use <!--Except in examples, as here!--> <code>{{!mxt|<nowiki>{{As of|{{CURRENTYEAR}}|{{CURRENTMONTH}}}}</nowiki>}}</code> or similar; that defeats the purpose of the template.
'''Required'''
*'''year''' (first parameter) – must be in full numerical format (''yyyy'')


'''Optional'''
Several additional named parameters can also be used, including some non-numeric input (see below).
*'''month''' (second parameter) – full, abbreviated or numerical formats supported (''mm'' recommended)
*'''day''' (third parameter) – numerical format only, not included in link (''dd'')


'''Named'''
===Parameters===
*'''alt''' – optional; allows substitution of different wording and case for the visible text output; if present but no value defined, this parameter is ignored; if a value is defined, any value for the ''lc'' parameter is ignored
====Required====
*'''lc''' – optional; gives lower case "as of ''date''" when defined; recommended syntax is ''lc=y''
* '''year''' (first parameter) must be in full numerical four-digit format ({{var|yyyy}})
*'''url''' – optional; adds an inline external link suggesting a webpage for future editors to check for updates to the statement; use the full URL with no spaces. See {{w|Wikipedia:As of#Article maintenance|Wikipedia:As of}} for displaying links.


==Examples==
====Optional====
:{{tld|As of|2010}} — {{As of|2010}}
* '''month''' (second parameter) – full, abbreviated, or two-digit numerical formats supported (<code>01</code> indicating January, <code>02</code> February, etc., but also accepting <code>Jan</code> and <code>January</code>)
:{{tld|As of|2010|7}} — {{As of|2010|7}}
* '''day''' (third parameter) – numerical two- or one-digit format only ({{var|dd}} or {{var|d}})
:{{tld|As of|2010|7|5}} — {{As of|2010|7|5}}
:{{tld|As of|2010|4|1|alt{{=}}as of the <nowiki>{{w|2010 United States Census}}</nowiki>}} — {{As of|2010|4|1|alt=as of the {{w|2010 United States Census}}}}
:{{tld|As of|2010|7|5|lc{{=}}y}} — {{As of|2010|7|5|lc=y}}
:{{tld|As of|2010|7|url{{=}}<nowiki>http://en.wikipedia.org/</nowiki>}} {{As of|2010|7|url=http://en.wikipedia.org}}


==Red link category appears==
====Named====
When you use this template, you may see two new categories appear at the bottom of the article: a redlinked category like {{redlink|Category:Articles containing potentially dated statements from...}} and [[:Category:Articles with invalid date parameter in template]]. This indicates that a category page for the year, year/month, or year/month/day has not yet been created.  
* '''alt''' – optional; allows substitution of different wording and case for the visible text output (including the date). If present with no value defined, this parameter is ignored; if a value is defined, values for <code>|df</code> and <code>|lc</code> and <code>|since</code> parameters are ignored.
* '''df''' – "date format", optional; allows use of American date format with {{para|df|US}}.  This only has an effect when the full <code>{{!}}{{var|year}}{{!}}{{var|month}}{{!}}{{var|day}}</code> format is also used.
* '''lc''' – "lower case", optional; if given any value at all (e.g. {{para|lc|y}}) gives lower case "as of {{var|date}}", for use mid-sentence.
* '''since''' – optional; if given any value at all (e.g. {{para|since|y}}) it changes "As of" to "Since". Use of {{para|lc|y}} with {{para|since|y}} gives "since {{var|date}}. Use of {{para|alt}} will replace the entire output, including the "Since", as it will with the default "As of".
* '''bare''' – Set to yes to display only the date with no accompanying text.
* '''pre''' – text to insert before the date, and after "[A|a]s of" or "[S|s]ince", e.g. {{para|pre|the first week of}} used like this: <code><nowiki>{{as of|1997|pre=the first week of}}</nowiki></code> produces "{{as of|1997|pre=the first week of}}".
* '''post''' &ndash; text (almost always punctuation) to insert between the date and the superscripted note that is displayed if the user has "<code>.asof-tag { display: inline !important; }</code>," "<code>.asof-tag.ref { display: inline !important; }</code>" or "<code>.asof-tag.ref { display: inline !important; }</code>" added to their [[Wikipedia:Common.js and common.css|common.css]] page {{crossref|(see {{section link|Wikipedia:As of#Article maintenance}})}}.
**  For these users,
**:: <code>{{tnl|As of|{{CURRENTYEAR}}|{{CURRENTMONTH}}|{{CURRENTDAY}}|post{{=}},}} no more bears were found</code>
**: gives
**:: <!--This example is hand-constructed on purpose!-->"As of {{CURRENTDAY}} {{CURRENTMONTHNAME}} {{CURRENTYEAR}},<sup>&#91;update&#93;</sup> no more bears were found"
**: (comma before the superscripted note)
** while
**:: <code>{{tnl|As of|{{CURRENTYEAR}}|{{CURRENTMONTH}}|{{CURRENTDAY}}}}, no more bears were found</code>
**: produces the undesirable result (contrary to [[WP:REFPUNC]]) with regard to the location of the comma:
**:: <!--This example is hand-constructed on purpose!-->"As of {{CURRENTDAY}} {{CURRENTMONTHNAME}} {{CURRENTYEAR}}<sup>&#91;update&#93;</sup>, no more bears were found"
:Note: the <sup>&#91;update&#93;</sup> tag is a tag that shows when '''url''' is not specified and the user has "<code><nowiki>.asof-tag { display: inline !important; }</nowiki></code>" or "<code><nowiki>.asof-tag.update { display: inline !important; }</nowiki></code>" added to their common.css page. It contains a link to edit the page.
* '''url''' – optional; adds an inline external link (hidden by default) suggesting a webpage for future editors to check for updates to the statement; use the full URL with no spaces.
::Note: This will only show if the user has "<code><nowiki>.asof-tag { display: inline !important; }</nowiki></code>" or "<code><nowiki>.asof-tag.ref { display: inline !important; }</nowiki></code>" added to their common.css page. It will show as a hyperlinked <sup>&#91;ref&#93;</sup> tag after the template. See [[Wikipedia:As of#Article maintenance]].


To fix this, click on the redlinked category within the article, then click {{xt|Create this page}}, and enter {{tlx|Articles containing potentially dated statements|{{xt|year}}|{{xt|month}}|{{xt|day}}}}, omitting the {{code|<nowiki>|day</nowiki>}} if the category isn't for a specific day, and omitting the {{code|<nowiki>|month</nowiki>}} if the category isn't for a specific month.  
===Examples===
* Replace the {{xt|year}} with the appropriate 4-digit year (e.g., 2016).
<!-- NOTE: DO NOT copy and paste this code to use the template. Copy and paste what it renders for today's date. -->
* Replace the {{xt|month}}, if used, with the appropriate full name of the month (e.g., February).
:{{tlc|As of|{{CURRENTYEAR}}}}  – {{As of|{{CURRENTYEAR}}}}
* Replace the {{xt|day}}, if used, with the appropriate day of the month, without leading zeros (e.g., 8).
:{{tlc|As of|{{CURRENTYEAR}}|{{CURRENTMONTH}}}}  – {{As of|{{CURRENTYEAR}}|{{CURRENTMONTH}}}}
:{{tlc|As of|{{CURRENTYEAR}}|{{CURRENTMONTH}}|{{CURRENTDAY}}}}  – {{As of|{{CURRENTYEAR}}|{{CURRENTMONTH}}|{{CURRENTDAY}}}}
:{{tlc|As of|{{CURRENTYEAR}}|{{CURRENTMONTH}}|{{CURRENTDAY}}|df{{=}}US}}  –  {{As of|{{CURRENTYEAR}}|{{CURRENTMONTH}}|{{CURRENTDAY}}|df=US}}
:{{tlc|As of|{{CURRENTYEAR}}|{{CURRENTMONTH}}|{{CURRENTDAY}}|lc{{=}}y}}  –  {{As of|{{CURRENTYEAR}}|{{CURRENTMONTH}}|{{CURRENTDAY}}|lc=y}}
<!-- As this next example is referring to the census date, doesn't make sense to use current date -->
:{{tlc|As of|2010|4|1|alt{{=}}as of the &#91;&#91;2010 United States census&#93;&#93;}} – {{As of|2010|4|1|alt=as of the [[2010 United States census]]}}
:<code>January 15, 2001 – {{tlc|As of|{{CURRENTYEAR}}|{{CURRENTMONTH}}|{{CURRENTDAY}}|alt{{=}}present|plaincode=on}}</code> – January 15, 2001 – {{As of|{{CURRENTYEAR}}|{{CURRENTMONTH}}|{{CURRENTDAY}}|alt=present}}
:{{tlc|As of|{{CURRENTYEAR}}|{{CURRENTMONTH}}|url{{=}}<nowiki>https://en.wikipedia.org/</nowiki>}} returns:
:: ''for logged in users, with links displayed (see [[Wikipedia:As of#Article maintenance|Wikipedia:As of]])'' – As of {{MONTHNAME|{{CURRENTMONTH}}}}{{space}}{{CURRENTYEAR}}<sup class="plainlinks">[https://en.wikipedia.org/ &#91;ref&#93;]</sup>
:: ''for all other users'' – As of {{MONTHNAME|{{CURRENTMONTH}}}}{{space}}{{CURRENTYEAR}}
:{{tlc|As of|{{CURRENTYEAR}}|{{CURRENTMONTH}}|{{CURRENTDAY}}|df{{=}}US|since{{=}}y}} –  {{As of|{{CURRENTYEAR}}|{{CURRENTMONTH}}|{{CURRENTDAY}}|df=US|since=y}}
:{{tlc|As of|{{CURRENTYEAR}}|{{CURRENTMONTH}}|{{CURRENTDAY}}|lc{{=}}y|since{{=}}y}}  –  {{As of|{{CURRENTYEAR}}|{{CURRENTMONTH}}|{{CURRENTDAY}}|lc=y|since=y}}


==See also==
===Maintenance categories===
*{{W|As of}}
* {{clc|Pages using as of template with unknown parameters}}
*{{W|Avoid statements that will date quickly}}
*[[Template:As of?]]
*[[Template:Category as of]]
*[[Template:Out of date]]
*[[Template:Show by date]]
*[[Template:Update]]
*[[Template:Update after]]
*[[:Category:All articles containing potentially dated statements]]


<includeonly>
===TemplateData===
<!-- ADD CATEGORIES BELOW THIS LINE -->
{{TemplateDataHeader}}
[[Category:Inline templates]]
[[Category:Temporal templates]]
[[Category:Time and date maintenance templates]]
 
</includeonly>
<templatedata>
<templatedata>
{
{
"description": "Use this template to mark potentially dated statements. It will add the article to a corresponding monthly or yearly hidden subcategory of Category:Articles containing potentially dated statements. This allows editors to catalogue statements that may become dated over time. It should not be used for statements mentioning future dates (use {{Update after}} instead).",
"format": "inline",
"params": {
"params": {
"1": {
"1": {
"label": "year",
"label": "Year",
"description": "must be in full numerical format (yyyy)",
"description": "The year the statement is valid to (in full; yyyy)",
"example": "2010",
"type": "number",
"example": "2013",
"required": true
"required": true
},
},
"2": {
"2": {
"label": "month",
"label": "Month",
"description": "Full, abbreviated or numerical formats supported (mm recommended)",
"description": "The month the statement is valid to. Full (January, january), abbreviated (Jan, jan) or numerical formats (01, 1) are supported. \"01\" provides the most consistency in wikitext, but all will be converted to \"January\" in articles and for categories.",
"example": "7",
"type": "line",
"example": "January, january, Jan, jan, 01, 1",
"suggested": true
"suggested": true
},
},
"3": {
"3": {
"label": "day ",
"label": "Day",
"description": "numerical format only, not included in link (dd)",
"description": "The day the statement is valid to, in numerical format (01 or 1; both will be converted to 1). This will show to users, but it will not be used to categorise the article.",
"example": "5"
"type": "number",
"example": "22"
},
"df": {
"label": "Date format",
"description": "If a day has been specified, enter \"US\" or \"us\" here to use the US date format (January 1, 2013). The default format is 1 January 2013.",
"type": "line",
"example": "US, us",
"autovalue": "US"
},
"lc": {
"label": "Lowercase",
"description": "Enter any text here to make the first letter of the template lowercase.",
"type": "boolean",
"example": "y",
"autovalue": "y"
},
},
"alt": {
"alt": {
"description": "allows substitution of different wording and case for the visible text output; if present but no value defined, this parameter is ignored; if a value is defined, any value for the lc parameter is ignored",
"label": "Alternative text",
"example": "as of the {{w|2010 United States Census}}"
"description": "Text to replace the \"As of [date]\". This will override the display of the template, but the values under month and year will still be used to categorise the article. Wiki markup is allowed.",
"type": "content",
"example": "As of Christmas 2018"
},
},
"lc": {
"since": {
"description": "gives lower case \"as of date\" when defined; recommended syntax is lc=y",
"label": "Since",
"example": "y"
"description": "Enter any text here to replace the text \"As of\" with \"Since\".",
"type": "boolean",
"example": "y",
"autovalue": "y"
},
},
"df": {},
"url": {
"url": {
"description": "dds an inline external link suggesting a webpage for future editors to check for updates to the statement; use the full URL with no spaces. See [[Wikipedia:As of]] for displaying links.",
"label": "URL",
"example": "http://en.wikipedia.org/"
"description": "(Hidden by default) A URL containing future updates to the statement for other editors to check. This will only show if the user has \".asof-tag { display: inline !important; }\" or \".asof-tag.ref { display: inline !important; }\" added to their common.css page. It will show as a hyperlinked superscript \"[ref]\" tag after the template. Enter the full URL with no spaces.",
"type": "url"
},
"pre": {
"label": "Pre-text",
"description": "Text to be added before the date",
"example": "the first week of",
"type": "string"
},
"post": {
"label": "Post-text",
"description": "Text to be added after the date, usually punctuation. Only necessary if the user wishes to ensure the punctuation/text is positioned before the superscript tags that are enabled by adding \".asof-tag.ref { display: inline !important; }\" to the commons.css page.",
"example": ".",
"type": "line"
},
"bare": {
"label": "Bare?",
"description": "Set to yes to display only the date with no accompanying text.",
"type": "boolean",
"suggested": true
}
}
},
},
"description": "The template is used to mark potentially dated statements, and will add an article to the appropriate sub-category of Category:All articles containing potentially dated statements.\n\nGenerally, specifying just the year or the year and month is preferred."
"paramOrder": [
"1",
"2",
"3",
"df",
"lc",
"alt",
"since",
"url",
"pre",
"post",
"bare"
]
}
}
</templatedata>
</templatedata>
<includeonly>
 
[[Category:Templates with TemplateData]]
==See also==
</includeonly>
* {{tl|As of?}}
* {{tl|Category as of}}
* {{tl|date}}
* {{tl|Present-day}}
* {{tl|Show by date}} / {{tls|Show by}}
* {{tl|Start date and age}}
* {{tl|Update}}
* {{tl|Update after}}
* {{tl|Update inline}}
* {{tl|Updated}} Like {{tl|As of}}, with reference as additional parameter
* {{tl|When}}
* [[Wikipedia:As of]] for details of dealing with statements that date quickly
* [[Wikipedia:Avoid statements that will date quickly]] for guidelines on using precise language when dealing with information that may date quickly
* [[:Category:Articles containing potentially dated statements]] and the accompanying {{tl|as of}} template
 
<includeonly>{{Sandbox other|
| <!-- ADD CATEGORIES BELOW THIS LINE -->
[[Category:Inline templates]]
[[Category:Temporal templates]]
[[Category:Time and date maintenance templates]]
 
}}</includeonly>
Anonymous user

Navigation menu