Template:Retrieved/sandbox: Difference between revisions
+date format validation |
ce; etc. |
||
Line 174: | Line 174: | ||
{{See also-text|{{slink|Template:Cite web|Date|Display options}}}} |
{{See also-text|{{slink|Template:Cite web|Date|Display options}}}} |
||
* {{bxtn|{{vanchor|df}}}}: Use to autoformat the display of [[#access-date|{{bxt|access-date}}]], irrespective of the way it was entered by the user. It is recommended, and will correctly format the access date in one of the {{em|full-date}} [[WP:DATE#Formats|acceptable date formats]] (partial dates are not supported). Except for the all |
* {{bxtn|{{vanchor|df}}}}: Use to autoformat the display of [[#access-date|{{bxt|access-date}}]], irrespective of the way it was entered by the user. It is recommended, and will correctly format the access date in one of the {{em|full-date}} [[WP:DATE#Formats|acceptable date formats]] (partial dates are not supported). Except for the all-numeric {{xt|YYYY-MM-DD}} ([[ISO 8601|ISO date]]) option, all other options display non-zero-padded days (i.e. {{xt|8 {{#time: F Y|-1 month}}}} instead of {{xt|08 {{#time: F Y|-1 month}}}}). Please follow the format, if any, established in the article’s citations and/or references{{snd}} see [[WP:DATEUNIFY]]; [[[#dfx|examples]]] |
||
** {{para|df|ymd|code=y}} or {{para|df|iso|code=y}}{{snd}} displays as the all-numeric {{xt|YYYY-MM-DD}} ([[ISO 8601|ISO date]]). |
** {{para|df|ymd|code=y}} or {{para|df|iso|code=y}}{{snd}} displays as the all-numeric {{xt|YYYY-MM-DD}} ([[ISO 8601|ISO date]]). |
||
** {{para|df|dmy|code=y}}{{snd}} displays as {{xt|Day Month Year}}. |
** {{para|df|dmy|code=y}}{{snd}} displays as {{xt|Day Month Year}}. |
||
Line 223: | Line 223: | ||
}} |
}} |
||
==Error |
==Error message examples== |
||
{{strong|Access date information is missing or not entered correctly|id=!dm}} |
{{strong|Access date information is missing or not entered correctly (parameter name)|id=!dm}} |
||
*<code><nowiki>{{retrieved/sandbox |access-info=subscription |</nowiki>{{!bxt|1=date={{#time:Y-m-d}}}}<nowiki> |via=OnlinePublisherName}}</nowiki></code><br/> |
*<code><nowiki>{{retrieved/sandbox |access-info=subscription |</nowiki>{{!bxt|1=date={{#time:Y-m-d}}}}<nowiki> |via=OnlinePublisherName}}</nowiki></code><br/> |
||
::{{retrieved/sandbox |access-info=subscription |date={{#time:Y-m-d}} |via=OnlinePublisherName}} |
::{{retrieved/sandbox |access-info=subscription |date={{#time:Y-m-d}} |via=OnlinePublisherName}} |
||
{{strong|Access date format is not valid|id=!df}} |
{{strong|Access date format is not valid (missing punctuation)|id=!df}} |
||
*<code><nowiki>{{retrieved/sandbox |access-info=subscription |</nowiki>{{!bxt|1=access-date={{#time: M j Y}}}}<nowiki> |via=OnlinePublisherName}}</nowiki></code></br> |
*<code><nowiki>{{retrieved/sandbox |access-info=subscription |</nowiki>{{!bxt|1=access-date={{#time: M j Y}}}}<nowiki> |via=OnlinePublisherName}}</nowiki></code></br> |
||
::{{retrieved/sandbox |access-info=subscription |access-date={{#time: M j Y}} |via=OnlinePublisherName}} |
::{{retrieved/sandbox |access-info=subscription |access-date={{#time: M j Y}} |via=OnlinePublisherName}} |
Revision as of 14:35, 18 September 2024
Retrieved 2025-01-03.
This is the template sandbox page for Template:Retrieved (diff). See also the companion subpage for test cases. |
This template implements Citation Style 1 template-like behavior regarding online-retrieval information ("Retrieved ..."), mainly as applied in {{cite web}}. It may be used with citation and external link templates that do not provide retrieval information, such as
and others; it may also be used to complement shortened footnote-producing templates such as {{harvnb}} and similar ( ). The template may accompany other allowable external links when such usage is appropriate. Please see § Exceptions for recommended exceptions. This template and its documentation make use of Citation Style 1 guidelines, with variations. Per common practice, "link" refers to a source's online location and "source" to its online content.
Note: All examples in this documentation use this page's current timestamp to autoformat dates. Tomorrow's date may temporarily display as a result, depending on the local timezone, time of day and Wikipedia system settings. To apply the current timestamp manually, below.
the page. See also- Example:
A [[Brad Pitt]] statement.<ref>{{IMDb name|id=0000093|name=Brad Pitt}}. {{retrieved/sandbox |access-date=2025-01-03}}</ref>
===References===
{{reflist}}
- Generates:
Usage
|
Syntax and presentation
For basic usage the template requires only the full date the source was retrieved (|access-date=<date>
) which displays after the static text "Retrieved" (see § Access date). Insert this template next to the prerequisite external link-providing template or when appropriate, after any other allowable external link. Ideally, this template's output should immediately follow the external link, allowing for preceding white space as needed (note the editable default for "Retrieved" is to appear capitalized). Copy a blank version to use. All parameter names must be in lowercase; unrecognized or misspelled optional parameters are ignored. Use the "|" (pipe) character between each parameter. Delete unused parameters. The template uses Citation Style 1 presentation mode as the default; it may optionally use Citation Style 2 mode. See § Parameters for important details.
Exceptions
This template should not be used when either the link or the source is inaccessible or unfit for any reason. Use only with wikitext-supporting sources (free or restricted) that are retrievable through working, legitimate external links. See Wikipedia:Link rot.
The template should also not be used when retrieval information is inapplicable, superfluous, or not recommended, such as in External links or Further reading sections, or with templates such as {{official website}}.
In general, do not use with stable or static external links e.g. links to online archives or repositories (however, it may be used when accessing online archive snapshots). Please see Wikipedia:External links.
Examples
Per the template default, the examples in this section display access dates in the user-entered format except when stated otherwise; the ISO date format (YYYY-MM-DD or ymd) is used to enter access dates. See also Note above.
Basic usage [info]
{{retrieved/sandbox |access-date=2025-01-03}}
- Retrieved 2025-01-03.
Basic usage with autoformatted access date display (dmy) [info]
{{retrieved/sandbox |access-date=2025-01-03 |df=dmy}}
- Retrieved 3 January 2025.
Basic usage with autoformatted access date display ("short" mdy) [info]
{{retrieved/sandbox |access-date=2025-01-03 |df=smdy}}
- Retrieved Jan 3, 2025.
Access information (registration) [info]
{{retrieved/sandbox |access-info=registration |access-date=2025-01-03}}
- . Retrieved 2025-01-03.
Access information (subscription) [info]
{{retrieved/sandbox |access-info=subscription |access-date=2025-01-03}}
- . Retrieved 2025-01-03.
Source comment (version info) [info]
{{retrieved/sandbox |prepend=Revised |access-date=2025-01-03}}
- Revised. Retrieved 2025-01-03.
Source format (image) [info]
{{retrieved/sandbox |format=[[JPEG]] |access-date=2025-01-03}}
- (JPEG). Retrieved 2025-01-03.
Online provider information [info]
{{retrieved/sandbox |access-date=2025-01-03 |via=OnlinePublisherName}}
- Retrieved 2025-01-03 – via OnlinePublisherName.
Link comment [info]
{{retrieved/sandbox |access-date=2025-01-03 |note=brief link note}}
- Retrieved 2025-01-03 (brief link note).
Custom terminal punctuation (semicolon) [info]
{{retrieved/sandbox |access-date=2025-01-03 |postscript=;}}
- Retrieved 2025-01-03;
No terminal punctuation [info]
{{retrieved/sandbox |access-date=2025-01-03 |postscript=none}}
- Retrieved 2025-01-03
All parameters in stated default presentation mode (Citation Style 1) [info]
{{retrieved/sandbox |access-info=limited |prepend=. Saved 2025-01-03 |format=[[DWG]] |access-date=2025-01-03 |via=[[Wayback Machine]] |note=archive [[Snapshot (computer storage)|snapshot]] link |mode=cs1 |postscript=none}}
- . Saved 2025-01-03 (DWG). Retrieved 2025-01-03 – via Wayback Machine (archive snapshot link)
All parameters with optional presentation mode (Citation Style 2) and autoformatted access date display (ymd) [info]
{{retrieved/sandbox |access-info=limited |prepend=, saved 2025-01-03 |format=[[DWG]] |access-date=2025-01-03 |df=ymd |via=[[Wayback Machine]] |note=archive [[Snapshot (computer storage)|snapshot]] link |mode=cs2 |postscript=;}}
- , saved 2025-01-03 (DWG), retrieved 2025-01-03 – via Wayback Machine (archive snapshot link);
Parameters
General notes
Depending on parameter usage, the template's output may display default presentation and formatting elements including static text, white space and other punctuation.
Parameters should provide retrieval information specific to the retrieved version of the source or to the specific access link. Do not add an optional parameter if identical information is provided in the source's external link template, full citation, or other reference data (the access date is required regardless of duplication). However, always include parameter access-info wherever applicable, as it is relevant to reader decisions regarding retrieval.
Required
The only required parameter is access-date or its alias accessdate.
Description
Access date
- access-date: This parameter (or its alias accessdate) is required – its omission or incorrect entry will produce an error message and will suppress all other template output. For basic usage, you may insert only this parameter. Enter the full date the external link: (a) was successfully accessed and (b) correctly targeted content supporting the related wikitext. Do not wikilink. Displays after the static text "Retrieved", as entered; it is advised to autoformat the date display via parameter df (date format) below. Use any of Wikipedia's full-date acceptable date formats but please follow the format, if any, established in the article’s citations and/or references – see WP:DATEUNIFY; [examples]
- Partial access dates (missing any of day, month or year) are strongly discouraged, and will produce inaccurate access date display or suppress it with an error message.
- Access dates that do not conform to full-date acceptable date formats will produce an error, see also following point.
- Some formatting errors may be avoided by using parameter df, which will correctly format the access date; see also Note below.
- Tomorrow's date will display as access date without error; access dates further in the future will display an error message instead of the access date.
Access information
- access-info: If the online source has access requirements or restrictions, use this parameter to add an indicative inline icon (includes tooltip). Ideally it should display immediately after the external link, preceded by a user-entered or pre-existing non-breaking space positioned before the template code. This parameter displays before the static text "Retrieved" (see § General notes); [examples]
|access-info=registration
– free registration is required; displays a gray lock icon.|access-info=limited
– free access is limited e.g. based on number of views, or is time-limited, or is only partially free; displays the same gray lock icon as registration, but with different tooltip text.|access-info=subscription
– paid subscription is required (WP:PAYWALL); displays a red lock icon. When set, the edited page will be added to Category:Pages containing links to subscription-only content.
Source comment, link comment
- prepend: Use for additional citable information specific to the retrieved version, only if necessary for clarity. This parameter displays before the static text "Retrieved"; [example].
- note: Use to add a brief relevant comment specific to the accessed link. Displays in parentheses after the access date or parameter via; [example].
Additional information: source format, online provider
- format: Use only when the retrieved version has special format requirements or is in a different format from the original. Displays within parentheses. May be wikilinked. This parameter displays before the static text "Retrieved"; [example].
- via: Use to cite the online provider specific to the source’s accessed version if said provider is different from the original provider or publisher. May be wikilinked. Includes the leading static text "via" preceded by a spaced en dash and followed by a space. Displays after the access date; [example].
Display options: date format, presentation mode, terminal punctuation
- df: Use to autoformat the display of access-date, irrespective of the way it was entered by the user. It is recommended, and will correctly format the access date in one of the full-date acceptable date formats (partial dates are not supported). Except for the all-numeric YYYY-MM-DD (ISO date) option, all other options display non-zero-padded days (i.e. 8 December 2024 instead of 08 December 2024). Please follow the format, if any, established in the article’s citations and/or references – see WP:DATEUNIFY; [examples]
|df=ymd
or|df=iso
– displays as the all-numeric YYYY-MM-DD (ISO date).|df=dmy
– displays as Day Month Year.|df=sdmy
– displays as Day Month Year but with "short" (abbreviated) month name.|df=mdy
– displays as Month Day, Year.|df=smdy
– displays as Month Day, Year but with "short" (abbreviated) month name.
- Note: Partial user-entered access dates are ambiguous and may display as today's full date by default when using parameter df.
- mode: Use to change the template presentation mode affecting element separators, terminal punctuation, and certain capitalization; the default is Citation Style 1 mode. To override default terminal punctuation regardless of mode use postscript; [examples]
|mode=cs2
– insert to switch to Citation Style 2 mode: the separator may include white space and/or a non-wrapping comma ( , ) or dash, terminal punctuation is omitted, and the static text "retrieved" is in lowercase.|mode=cs1
– the default presentation mode; enter to explicitly state/switch back to the Citation Style 1 mode: the separator may include white space and/or a non-wrapping period ( . ) or dash, terminal punctuation is a non-wrapping period, and the static text "Retrieved" is capitalized.
- postscript: Use to replace the presentation mode's default terminal punctuation. Insert
|postscript=none
to remove terminal punctuation altogether; [examples].
With short citations
Short citations (WP:SFN) may include external links as in-source locations and be subject to the same retrieval information guidelines applying to full citations.[a] This template may be used to complement select short citation-producing templates, e.g. {{harvnb}}. .
In the example below, {{harvnb}} output is followed by a non-breaking space to provide continuity and context relative to the output of {{retrieved}}.
- Example:
A wikitext statement.<ref>{{harvnb|AuthorLast|2025|pp=[https://www.example.com 23–24]}}{{nbsp}}{{retrieved/sandbox |access-info=subscription |access-date=2025-01-03}}</ref>
===Notes===
{{reflist}}
===References===
{{refbegin}}
* {{cite journal |author-last=AuthorLast |date=January 2025 |title=ArticleTitle |journal=JournalName |issue=5 |pages=21–35 |url=https://example.com |url-access=limited |access-date=2025-01-03}}
{{refend}}
- Generates:
Notes
- ^ AuthorLast 2025, pp. 23–24 . Retrieved 2025-01-03.
References
- AuthorLast (January 2025). "ArticleTitle". JournalName (5): 21–35. Retrieved 2025-01-03.
- ^ The full citation's retrieval information may not apply to short citations for a number of reasons. Specific in-source locations may have different access and/or retrieval requirements. Also, depending on either the full or short citation's access date, the state of external links or the source's content may vary.
Error message examples
Access date information is missing or not entered correctly (parameter name)
{{retrieved/sandbox |access-info=subscription |date=2025-01-03 |via=OnlinePublisherName}}
Access date format is not valid (missing punctuation)
{{retrieved/sandbox |access-info=subscription |access-date=Jan 3 2025 |via=OnlinePublisherName}}
- . Retrieved Jan 3 2025! Access date format is invalid [info] ! – via OnlinePublisherName.
Access date is partial or incorrect
{{retrieved/sandbox |access-info=subscription |access-date=01-2025 |via=OnlinePublisherName}}
- . Retrieved ! Partial or incorrect access date [info] ! – via OnlinePublisherName.
Access date is beyond tomorrow's date
{{retrieved/sandbox |access-info=subscription |access-date=2025-01-05 |via=OnlinePublisherName}}
- . Retrieved ! Invalid future access date [info] ! – via OnlinePublisherName.
See also
TemplateData
TemplateData for Retrieved
This template adds online-retrieval information ("Retrieved ...") to external link templates that do not provide such facility; for additional use cases see the template's documentation
Parameter | Description | Type | Status | |
---|---|---|---|---|
Access information | access-info | Recommended when the source has access restrictions; use one of 'registration', 'subscription' or 'limited' (without the single quote marks), displays a relevant lock icon before "Retrieved" | String | optional |
Source comment | prepend | Use only when additional citable information specific to the retrieved version is needed for clarity; displays before "Retrieved" | String | optional |
Source format | format | Use only if the retrieved version is in different format than the original, or has specific format requirements; may be wikilinked, displays before "Retrieved" | String | optional |
Access date | access-date accessdate | The full date the external link (a) was successfully accessed, and (b) targeted relevant wikitext-supporting content. Displays as entered; but see 'Access date format' for acceptable display options; do not wikilink | Date | required |
Access date format | df | Optional but recommended access date display options; use 'ymd' or 'iso' for all-numeric year-month-date, 'dmy' for Day Month Year, 'mdy' for Month Day, Year, 'sdmy' for Day Month Year with abbreviated month name, 'smdy' for Month Day, Year with abbreviated month name (omit the single quote marks) | String | suggested |
Online provider | via | Name of the accessed version's online provider if other than the publisher; may be wikilinked | String | optional |
Link comment | note | When required for clarification, add a brief note specific to the accessed link | String | optional |
Presentation mode | mode | Presentation mode affecting static text, parameter separators and terminal punctuation. Default is Citation Style 1 mode; use 'cs2' for Citation Style 2, or 'cs1' to switch to/state the default (ommit the single quote marks) | String | optional |
Terminal punctuation | postscript | Insert desired value to replace the presentation mode's default terminal punctuation; to remove terminal punctuation enter 'none' without the quote marks | String | optional |