This MedLibrary.org supplementary page on Template:Cite web/sandbox is provided directly from the open source Wikipedia as a service to our readers. Please see the note below on authorship of this content, as well as the Wikipedia usage guidelines. To search for other content from our encyclopedia supplement, please use the form below:
Related Sponsors
If you have made any changes to the code of this template you need to purge this page to see the changes in these examples.
Contents |
none
{{cite web/sandbox|title=Example|url=http://example.com/|publisher=Example Inc.|accessdate=2008-01-01|date=2008-01-01}}
Generates: "Example". Example Inc. (1 January 2008). Retrieved on 2008-01-01.
Current coding error
NO red-linked dates, i.e. 2008-01-01, if a user has no date preference set, in this example where hard coded date stylining (so why previously failed using a metatemplate for simpler coding ?) David Ruben Talk 17:37, 14 July 2008 (UTC)
NB meta:Help:Date_formatting_and_linking#Accessibility of date preference for branching states "The date format cannot be detected with #ifeq, because the date format is converted after expansion of parser functions." so not possible, it seems to detect user date format within a parser function. Is this why pervious metatemplate works on its own but not within another parser fuction ? Get rid of format test therefore in this example - hence entries either:
- Wikified showing user-preference but for majority of users (who have not set ther preference and the case for all anons) as a blue linked ISO YYYY MM-DD
- Else one of 3 editor-selected unlinked fixed formats.
blank
{{cite web/sandbox|title=Example|url=http://example.com/|publisher=Example Inc.|accessdate=2008-01-01|date=2008-01-01|datestyle=}}
Generates: "Example". Example Inc. (1 January 2008). Retrieved on 2008-01-01.
DMY
{{cite web/sandbox|title=Example|url=http://example.com/|publisher=Example Inc.|accessdate=2008-01-01|date=2008-01-01|datestyle=dmy}}
Generates: "Example". Example Inc. (1 January 2008). Retrieved on 2008-01-01.
MDY
{{cite web/sandbox|title=Example|url=http://example.com/|publisher=Example Inc.|accessdate=2008-01-01|date=2008-01-01|datestyle=mdy}}
Generates: "Example". Example Inc. (1 January 2008). Retrieved on 2008-01-01.
YMD
{{cite web/sandbox|title=Example|url=http://example.com/|publisher=Example Inc.|accessdate=2008-01-01|date=2008-01-01|datestyle=ymd}}
Generates: "Example". Example Inc. (1 January 2008). Retrieved on 2008-01-01.
Pre 1970 issue
Because Unix cannot handle dates before 1970, these can not be converted into date styles by the wikipedia parserfunction {{#time: }} function:
- Hence {{#time:Y-m-d|1975-09-15}}| shows as 1975-09-15 but {{#time:Y-m-d|1935-09-15}}| shows as 1935-09-15
However early dates can be wikified:
Hence where datestyle is defined, we need to trap dates before 1970. This is done by an initial test date styling and seeing if the outcome is 1970-01-01, in which case no formating is applied and the date is shown as unlinked free text:
{{cite web/sandbox|title=Example|url=http://example.com/|publisher=Example Inc.|accessdate=1935-01-01|date=1935-01-01|datestyle=dmy}}
Generates: "Example". Example Inc. (1 January 1935). Retrieved on 1935-01-01.
Mis-formated dates
Some examples of where dates wrongly formated or presented already partly wikilinked (datestyle set to "mdy" throughout). All result in some form of a date being shown (ie no "error" is seen to occur). In practice any date value that can not be formated (as is the case if already manually part wikilinked) is show directly as that parameter value (i.e. the wikilinked value itself). Hence in examples below "3rd February 2008" can be formated and so this is undertaken, but the template and parser functions do not reconginse say "[[20 May]] [[2007]]", "[[20 May]],[[2007]]" or "[[20 May]] of the year [[2007]]" and these are shown directly as entered. This show as-is if any sort of error is needed to cope with MediaWiki's bugs of not being able to handle dates before 1901.
- date=[[20 May]] [[2007]]
"Example". Example Inc. (20 May 2007). - date=20 May 2007
"Example". Example Inc. (20 May 2007). - date=[[May 20]] [[2007]]
"Example". Example Inc. (May 20, 2007). - date=3rd February 2008
"Example". Example Inc. (3rd February 2008). - date=[[20 May]] [[1968]]
"Example". Example Inc. (20 May 1968). - date=[[2007-04-13]]
"Example". Example Inc. (2007-04-13).
Finally compare handling for a pre-1901 date:
- date=[[20 May]] [[1884]] & datestyle=mdy not a date format and so shown as-is
"Example". Example Inc. (20 May 1884). - but date=1884-05-20 & datestyle=mdy - cannot be formated as pre-1901
"Example". Example Inc. (20 May 1884). - but date=1884-05-20 & datestyle blank (i.e. forcing wikified dates)
"Example". Example Inc. (20 May 1884).
Wikipedia content modification information:
- This page was last modified on 9 November 2008, at 18:52.
Wikipedia Authorship and Review
Wikipedia content provided here is not reviewed directly by MedLibrary.org. Wikipedia content is authored by an open community of volunteers and is not produced by or in any way affiliated with MedLibrary.org.
Wikipedia Usage Guidelines
This article is licensed under the GNU Free Documentation License. It uses material from the Wikipedia article on "Template:Cite web/sandbox".
The URL for this specific entry is:
All Wikipedia text is available under the terms of the GNU Free Documentation License. (See Copyrights for details). Wikipedia® is a registered trademark of the Wikimedia Foundation, Inc.
