Template talk:Citation/core/Archive 4

Archive 1Archive 2Archive 3Archive 4Archive 5Archive 6Archive 10

access date formatting

In the past the access date was automatically formatted as "Day Month Year" now it is coming out as entered "yyyy-mm-dd" for example (which at one time was the required input format and it was changed to a readable format - making this problem worse). I propose that we pass the AccessDate parameter through the date template using the format "dmy" see {{date}} for documentation. This should handle all of the different cases

Input format Output text
Month Year January 2001
Year 2001
ISO 15 January 2001
Month day, year 15 January 2001
Day Month Year 15 January 2001
misspelling Janary 15, 2001

The updated text(changes in red):

  }}{{
     #if: {{{AccessDate|}}}
     | <span class="reference-accessdate">{{#ifeq:{{{Sep|,}}}|,|, r|. R}}etrieved on {{date|{{{AccessDate}}}|dmy}}</span>
     }}

--Trödel 15:29, 18 May 2009 (UTC)

No. Access date should use the same format as the body of the article, and the template has no way to know what that format is. --Jc3s5h (talk) 15:48, 18 May 2009 (UTC)
then please fix what you have broken -i.e. go through all the citations templates I have used from 2006 until this change and update the parameter that required an ISO format to match the current article --Trödel 15:51, 18 May 2009 (UTC)
Why don't you try to make the people who introduced date autoformatting do it? That is the root of this evil. Oh, by the way, you know that every ISO 8601 date is either in the Gregorian calendar, or wrong, right? I suspect we have a few citations to sources printed before the British adopted the Gregorian calendar. --Jc3s5h (talk) 16:14, 18 May 2009 (UTC)
For more on this topic, please see #Please don't mess with editor's date format above, along with the following topics. Eubulides (talk) 19:29, 18 May 2009 (UTC)
I understand the problem started with the introduction of using ISO dates - however, date format has been a constant matter of debate since the early days of Wikipedia with good arguments on both sides. Maybe you guys could have done something intelligent and converted only ISO dates to something human readable.
Secondly, regardless of the source of the problem, there were many articles that had dates that displayed properly that were broken by the decision to just output the date as inserted. Templates SHOULD NOT break the displayed text ever. I have designed templates, and fixed issues in templates that were introduced by other well intentioned, and excellently implemented ideas that after being implemented for some time, were discovered to not work as effectively or as efficiently as desired. In these cases, I fixed the impacted articles myself, or enlisted those with bots to help with the fix.
Perhaps instead of being dogmatic you could think of a way to fix the problem that has been created by this new standardization.
What really is insulting is that you assume that your way will be "the way for all time" - when, in fact, you don't know if it will be or if consensus will over time decide something different. I am sure that you don't want all the articles that you edited and used the citation templates, to suddenly not output the information as you expect it to be outputted, and as it did output when you inserted the template into the article.
Maybe you could find it in your heart to help figure out a solution to this problem, you never know if you will be asking someone to not undo all your hard work a couple years from now. --Trödel 01:00, 19 May 2009 (UTC)
Short of visiting each template instance and adjusting it to match the rest of the article, I can see no solution. There just isn't enough information accessible to the template to decide what the date format should be. --Jc3s5h (talk) 01:19, 19 May 2009 (UTC)
I have reviewed the comments above and have been doing some research on this issue. As you state there is no easy solution, and it is much more complicated than I thought when I initially posted. Thanks for your patience while I've caught up to speed.
The templates that I have a problem with are {{Cite web}}, {{Cite journal}}, {{Cite news}}, {{Cite press release}}, and {{Cite book}}. These all had a parameter "accessdate" that you were required to put in yyyy-mm-dd format and that automatically converted to the dd mmmm yyyy format. Now they, from what I can tell, pass the "accessdate" into {{Citation}} as "AccessDate". The documentation was changed to not require yyyy-mm-dd format with this change on 9 November 2008 with no real explanation of why it was changed. Therefore we have two things that I think can help solve this problem.
  1. There is no issue with old dates - the parameter in question is the last time the source was accessed or referred to, so we don't have to worry about Julian or other different calendar formats (unless someone travels back in time to refer to a source prior to the adoption of the Gregorian calendar :) and
  2. The date automatically converted until November 2008.
Therefore, it seems reasonable to convert the older templates Cite web, Cite journal, Cite news, Cite press release, Cite book to reformat yyyy-mm-dd formated accessdate (only) to dd mmmm yyyy format, and leave the other citation templates as is so that the accessdate will work like they do now.
Thoughts? Am I missing something here? --Trödel 16:58, 19 May 2009 (UTC)
Your solution presumes that in an article using the format month dd month yyyy, it is better to reformat an accessdate in the yyyy-mm-dd format to dd month yyyy than to leave it alone. Since both yyyy-mm-dd and dd month yyyy are wrong in such an article, I don't see the improvement. Furthermore, the change would make the templates behave in a manner that is indecipherable to someone who does not find the right spot in the documentation. I beleive it is better to have simple, predictable templates than to substitute one error for another. --Jc3s5h (talk) 17:18, 19 May 2009 (UTC)
I assume you mean "... an article using the format month dd yyyy..." However, there is an improvement because the articles that inserted the templates knowing that it would reformat dd mmmm yyyy would now format correctly and as expected. We could even do a test on the date - if the retrieved on date is between 2005 and 2008 then reformat the date - then all the articles that had the template inserted into them during that time would work exactly as when the template was inserted. --Trödel 21:33, 20 May 2009 (UTC)
  • Would it be simpler for a bot to reformat unsavoury dates in the articles themselves, rather than coding redundancy into the template? I could easily make the Citation bot do this, if you gave me a set of requirements to follow. Martin (Smith609 – Talk) 22:47, 20 May 2009 (UTC)
I think a citation bot run that changes the YYYY-MM-DD format to the dd month yyyy format only for the 2005 through 2008 period would have the benefit mentioned by Trödel of restoring the appearance of the displayed citation to the same format it had when the original editor looked at it, without burdening future users with a quirky interface, and future coders with lots of special case code. If the date range can be narrowed down some more, that would be even better. --Jc3s5h (talk) 22:57, 20 May 2009 (UTC)
The formatting was finally removed with this edit. Happymelon 23:27, 20 May 2009 (UTC)
Well, feel free to give me a precisely worded definition of what the bot should do, and I'll gladly code and run it. User talk:Citation bot would be the best place to post this description. Martin (Smith609 – Talk) 16:53, 21 May 2009 (UTC)
Thank you for the offer - I will think carefully about how to word the instructions that address the concerns here. --Trödel 12:36, 22 May 2009 (UTC)
Have the MOSNUM date debates finally come to a conclusion? Has the injunction against mass conversion of dates been lifted? Until then, I'd suggest not touching it with a 10 feet (3.0 m) pole.LeadSongDog come howl 23:03, 20 May 2009 (UTC)
Just checked. The Wikipedia:Requests_for_arbitration/Date_delinking#Temporary_injunction still is in effect.LeadSongDog come howl 23:07, 20 May 2009 (UTC)
Let's please just leave the dates alone. A template should not try to format a date, or make it look nicer, or wikilink it, etc. Such efforts in the long run cause more trouble than they cure. Any hack that would format only dates in the 2005–2008 range would be enormously confusing. Eubulides (talk) 23:23, 20 May 2009 (UTC)
Indeed; the template should, at most, do what it's told, not what it thinks is the clever thing to do. Happymelon 23:27, 20 May 2009 (UTC)
  • if you want dates formatted, wrap them in {{date}}. for example: |accessdate={{Date|2009-05-29|mdy}}. it's not much more work for the editor, and each page can be formatted consistently according to the consensus for that page.  —Chris Capoccia TC 08:53, 29 May 2009 (UTC)
    • The {{date}} template is essentally useless in this situation. The format must be specified (unless you want the default, d month yyyy). It's easier to just put the date in the format you want to begin with. --Jc3s5h (talk) 16:25, 29 May 2009 (UTC)
but with the template, i don't have to worry about mistakes like spelling, capitalization, forgetting a comma... i just type the digits and i'm off. later if someone wants to change the dates from mdy to dmy or something, it's trivial to do so.  —Chris Capoccia TC 16:35, 29 May 2009 (UTC)

Minor change - separator in front of "Retrieved on"

Suggesting update by replacing

 ifeq:{{{Sep|,}}}|,|, r|. R}}etrieved on

with [1]

 ifeq:{{{Sep|,}}}|.|. R|{{{Sep|,}}} r}}etrieved on

After: [2]

Doe, John (2005-04-30); "Encyclopedia of things"; My favorite things part II; Open Publishing; Retrieved on 2005-07-06

Ma3ko7 (talk) 18:23, 19 May 2009 (UTC)

Date autoformatting

It might be worth considering using {{#formatdate:xxx}} in this template. It will format (but not link) dates according to logged in editors preferences. See Help:Magic words on the MediaWiki site. —Locke Coletc 02:45, 30 May 2009 (UTC)

Any such usage should not change existing dates, which by default should not be formatted. Please see #Please don't mess with editor's date format and #access date formatting above. It could be a new parameter, though; that would be upward-compatible. Eubulides (talk) 03:45, 30 May 2009 (UTC)
Date autoformatting has been rejected by the community in its present form. While a RfC in late 2008/early 2009 showed a narrow majority favors some form of date autoformatting, no particular form has been decided on. Adopting any particular form in templates in advance of general use in articles will create the same kind of entanglements that we are presently recovering from as template editors try to decontaminate the templates from the influence of the woefully bad design of the present autoformatting system. --Jc3s5h (talk) 14:38, 30 May 2009 (UTC)
The formatdate function was developed after the community rejected the current system, and the two are unrelated (other than formatdate utilizing Special:Preferences to determine what date format to use for logged in readers). Further, it's highly unlikely you'd want linked and autoformatted dates in citations, so it's unlikely we'll need to change this once implemented. —Locke Coletc 14:50, 30 May 2009 (UTC)
There is no consensus to use the formatdate function. It was put into the wiki software by a developer with no attempt to seek consensus from the editing community. --Jc3s5h (talk) 15:15, 30 May 2009 (UTC)
Not everything need be discussed prior to being implemented (especially in a case like this where it makes sense). As an aside, we're here right now discussing adding this. It avoids one of the core problems with the prior system (linked dates/years) while keeping what the community seemed to accept as "useful" (date autoformatting). That seems like a good enough reason to use it if. —Locke Coletc 15:29, 30 May 2009 (UTC)
Date autoformatting is currently depricated in articles. Using formatdate in the citations but not in the article will cause an inconsistent display of dates between the body text and the citations for those who log in choose a date preference. --Jc3s5h (talk) 15:45, 30 May 2009 (UTC)
It would however make citations consistent which is a step in the right direction. Article consistency will come, hopefully with a fixed Dynamic Dates system that loses the auto linking and retains the auto formatting. —Locke Coletc 16:01, 30 May 2009 (UTC)
  • Per your wishes, Locke, Ryan’s date linking RfC was not on a specific date autoformatting technology, but on the generalities of date autoformatting, which the community rejected. Ryan and the ArbCom concluded that the RfC results constituted a consensus.

    I know this outcome was not to your liking, but I know full well you are aware of these facts. Yet here you are, persisting in yet another venue. This was tedious before, and now it is exceedingly tedious. Do you not see something else for you to do on Wikipedia you would find rewarding? Greg L (talk) 19:11, 30 May 2009 (UTC)

It could be useful if we could write i.e. {{reflist|2|dmy}} to format all the reference dates to dmy format. That would require some kind of communication between templates though, which I think is currently impossible. Per-user autoformatting is rather useless and would cause inconsistencies within the article, as pointed out above. Well, unless we start doing article text autoformatting again, which we won't. --Apoc2400 (talk) 20:29, 30 May 2009 (UTC)

The inconsistencies would only exist until a system of auto formatting was developed that could be used in articles. The preference would be used for both and provide consistency. —Locke Coletc 21:04, 30 May 2009 (UTC)
The inconsistencies would only exist until all dates in articles are consistently formatted. At present, there is no requirement for that - it's only a guideline, remember?? ;-) Ohconfucius (talk) 12:13, 31 May 2009 (UTC)

Unnecessary code

Isn't the second

#if:{{{OriginalURL|}}}

always true? Tocant (talk) 12:25, 3 June 2009 (UTC)

Well spotted. I've removed it. Martin (Smith609 – Talk) 13:45, 3 June 2009 (UTC)
Looking at this again there are other problems with this code, the following returns the wrong error when url is empty:
{{cite news | author=Author | title=Title | url= | accessdate=11 December 2005 | archiveurl=http://archiveurl/ | archivedate=28 June 2008 }}
Author. "Title". {{cite news}}: |access-date= requires |url= (help); |archive-url= requires |url= (help); |author= has generic name (help)
Tocant (talk) 14:31, 3 June 2009 (UTC)
  Fixed. I hope I've not caused any side-effects - I didn't notice any. Martin (Smith609 – Talk) 22:42, 3 June 2009 (UTC)

Test cases

All 8 combinations of url, archiveurl and archivedate:

1. {{cite news | author=Author | title=Title | url= | archiveurl= | archivedate= }}
2. {{cite news | author=Author | title=Title | url=http://url/ | archiveurl= | archivedate= }}
3. {{cite news | author=Author | title=Title | url= | archiveurl=http://archiveurl/ | archivedate= }}
4. {{cite news | author=Author | title=Title | url= | archiveurl= | archivedate=28 June 2008 }}
5. {{cite news | author=Author | title=Title | url=http://url/ | archiveurl=http://archiveurl/ | archivedate= }}
6. {{cite news | author=Author | title=Title | url=http://url/ | archiveurl= | archivedate=28 June 2008 }}
7. {{cite news | author=Author | title=Title | url= | archiveurl=http://archiveurl/ | archivedate=28 June 2008 }}
8. {{cite news | author=Author | title=Title | url=http://url/ | archiveurl=http://archiveurl/ | archivedate=28 June 2008 }}

1. Author. "Title". {{cite news}}: |author= has generic name (help)

2. Author. "Title". {{cite news}}: |author= has generic name (help); Check |url= value (help)

3. Author. "Title". {{cite news}}: |archive-url= requires |archive-date= (help); |author= has generic name (help)

4. Author. "Title". {{cite news}}: |archive-date= requires |archive-url= (help); |author= has generic name (help)

5. Author. "Title". {{cite news}}: |archive-url= requires |archive-date= (help); |author= has generic name (help); Check |archiveurl= value (help)

6. Author. "Title". {{cite news}}: |archive-date= requires |archive-url= (help); |author= has generic name (help); Check |url= value (help)

7. Author. "Title". {{cite news}}: |archive-url= requires |url= (help); |author= has generic name (help)

8. Author. "Title". Archived from the original on 28 June 2008. {{cite news}}: |author= has generic name (help); Check |archiveurl= value (help); Check |url= value (help)


Some of these errors are incorrect or absent. Maybe it is easier not to have any requirements that certain parameters must be specified when archiveurl and archivedate are used? What if the archive is a scanned copy of a newspaper with unknown (unimportant) archivedate?

It is also illogical that Citation/core complains about missing url (it is OriginalUrl that is missing) and archiveurl (not even a Citation/core parameter), the error handling should probably be done by the calling template. Tocant (talk) 09:48, 4 June 2009 (UTC)

Would this be fixed if I changed the error message to something along the lines of 'Missing URLs in citation template'? In the case you state, a url would suffice (without an archiveurl). Martin (Smith609 – Talk) 14:06, 4 June 2009 (UTC)
Yes, that might be a good solution! Tocant (talk) 14:21, 4 June 2009 (UTC)

Titles that start with a quote

I've noticed that in order to render properly (itallic, not bolded) I occasionally have to hack cite news title parameters with initial quotation, e.g.
title=&nbsp;'Ya fiyad': Ivana
I'm not sure where this problem originates, in the core or in {{cite news}}, but headline writers evidently love to lead off with a quote, making this rather annoying. Any hints? LeadSongDog come howl

Sounds like a bug in the template to me. Surely can work around it with {{'}}, e.g., "title= {{'}}Ya fiyad': Ivana". Eubulides (talk) 16:41, 3 June 2009 (UTC)
That seems to have its own problems. I'm wondering about the metadata emitted in each case, but I suppose either hack could be readily bot-fixed once the bug is found. Oddly the bolding bug doesn't exhibit today on IE6, but there still is strangeness. Consider the following cases that I'd expect to yield much the same thing (evidently the curly single quote breaks in {{}}where the straight single works in {{'}}. Case 8 is particularly weird:

Nowiki:

  1. {{cite news |url=http://www.nytimes.com/2009/05/28/health/policy/28flu.html |title='Underlying conditions' may add to flu worries |publisher=New York Times |date=27 May 2009}}
  2. {{cite news |url=http://www.nytimes.com/2009/05/28/health/policy/28flu.html |title= 'Underlying conditions' may add to flu worries |publisher=New York Times |date=27 May 2009}}
  3. {{cite news |url=http://www.nytimes.com/2009/05/28/health/policy/28flu.html |title=Underlying conditions' may add to flu worries |publisher=New York Times |date=27 May 2009}}{{'}}
  4. {{cite news |url=http://www.cbc.ca/health/story/2009/06/01/ontario-swineflu-death.html |title='Atypical' Toronto swine flu victim had other medical condition: official |date=May 25, 2009}}
  5. {{cite news |url=http://www.cbc.ca/health/story/2009/06/01/ontario-swineflu-death.html |title= 'Atypical' Toronto swine flu victim had other medical condition: official |date=May 25, 2009}}
  6. {{cite news |url=http://www.cbc.ca/health/story/2009/06/01/ontario-swineflu-death.html |title=Atypical' Toronto swine flu victim had other medical condition: official |date=May 25, 2009}}{{'}}
  7. {{cite news|title='Ya fiyad': Ivana}}
  8. {{citation|title='Ya fiyad': Ivana}}
  9. {{cite web|title='Ya fiyad': Ivana|url=http://x.com}}
  10. {{cite news|title={{'}}Ya fiyad': Ivana}}
  11. {{citation|title={{'}}Ya fiyad': Ivana}}
  12. {{cite web|title=Ya fiyad': Ivana|url=http://x.com}}{{'}}
  13. {{cite news|title= 'Ya fiyad': Ivana}}
  14. {{citation|title= 'Ya fiyad': Ivana}}
  15. {{cite web|title= 'Ya fiyad': Ivana|url=http://x.com}}

Bare cites:

  1. "'Underlying conditions' may add to flu worries". New York Times. 27 May 2009.
  2. " 'Underlying conditions' may add to flu worries". New York Times. 27 May 2009.
  3. "Underlying conditions' may add to flu worries". New York Times. 27 May 2009.'
  4. "'Atypical' Toronto swine flu victim had other medical condition: official". May 25, 2009.
  5. " 'Atypical' Toronto swine flu victim had other medical condition: official". May 25, 2009.
  6. "Atypical' Toronto swine flu victim had other medical condition: official". May 25, 2009.'
  7. "'Ya fiyad': Ivana".
  8. 'Ya fiyad': Ivana
  9. "'Ya fiyad': Ivana".
  10. "'Ya fiyad': Ivana".
  11. 'Ya fiyad': Ivana
  12. "Ya fiyad': Ivana".'
  13. " 'Ya fiyad': Ivana".
  14.  'Ya fiyad': Ivana
  15. " 'Ya fiyad': Ivana".

Same ones wrapped in ref tags: [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15]

LeadSongDog come howl 21:46, 3 June 2009 (UTC)

Argh! How about "&#39;" to work around the problem instead? That's yucky, but it should work. Thus:
  • {{cite news |url=http://www.nytimes.com/2009/05/28/health/policy/28flu.html |title=&#39;Underlying conditions' may add to flu worries |publisher=New York Times |date=27 May 2009}}
  • "'Underlying conditions' may add to flu worries". New York Times. 27 May 2009.
Eubulides (talk) 22:14, 3 June 2009 (UTC)
I'm not seeing any bolding problems in Firefox - the only thing I have noticed is that the opening quote may be inappropriately unitalicised (as in #8). I've fixed that; it's possible that my fix will resolve other issues. If it doesn't, please post an example, along with an explanation of how it differs from the expected behaviour. Martin (Smith609 – Talk) 22:59, 3 June 2009 (UTC)

Is there any way to check if someone has used the {{'}} work-around already? That breaks COinS. --Karnesky (talk) 23:19, 3 June 2009 (UTC)

Thanks Martin, whatever you did seems to have sorted the problem with #8, putting the backlink caret where it belongs. I'm not seeing the bolding now on IE7 either. I'll check on IE6 tomorrow to see how that fared. It looks like the wikitext hacks are no longer needed.LeadSongDog come howl 04:10, 4 June 2009 (UTC)
A quibble: this change added about 2.2 kilobytes to Autism. Granted, the article's big already, but is there some way to fix the bug that requires fewer bytes than putting <span></span> around every title? For example, could we surround a title with a span only if the title starts or ends with troublesome characters? Eubulides (talk) 16:22, 4 June 2009 (UTC)
It does look the same on IE6 as IE7, though Eubulides point makes sense. I must comment that visually, I find having some type of perceivable gap breaking up the triple quote is a good thing, not only for stylistic reasons but for clarity of intent. When someone (e.g. a google spider) copies the browser-rendered html of a citation and puts it somewhere as plain text it should remain intelligible in an ideal world. LeadSongDog come howl 16:43, 4 June 2009 (UTC)
As In understand it, addressing Eublides' point would increase page load times. Currently, the page parser evaluates the entirety of an {if:} template call - both the true and the false part - before discarding the part that it doesn't need. Putting in functions to deduce whether the title started with an apostrophe would add more, not less, overhead. I would interpret WP:DWAP to suggest that looking for ways to remove every surplus byte would not be time well spent. Martin (Smith609 – Talk) 16:58, 4 June 2009 (UTC)
Please see #A shorter fix for "title='Ouch" below. Eubulides (talk) 20:26, 4 June 2009 (UTC)

A shorter fix for "title='Ouch"

I looked into this a bit more, and found that it's easy to fix the problem without adding a couple of kilobytes to Autism. First, <span></span> isn't needed for titles appearing in double-quotes. Second, <span></span> isn't needed for italicized titles that are external links, since the brackets protect against misinterpretation of apostrophes. The only problem case is an italicized title that is not an external link (as in #8 above). It's easy and cheap to introduce <span></span> only in that case. I have tested this in the sandbox, and it fixes #8. The idea is to remove the <span></span>s, and to use {{Italiclink}} rather than ''{{Link}}''. Could you please install that fix? Thanks. Eubulides (talk) 20:26, 4 June 2009 (UTC)

That looks much more elegant - good work. In your fix, you have only replaced one link template with an italiclink. Before I make the change, I thought I should check that this was intentional, and that the removal of the span in the first link template won't perpetuate problems. Martin (Smith609 – Talk) 14:31, 5 June 2009 (UTC)
Yes, that was intentional. The span isn't needed in the other case, because that case is surrounded by double-quote ("), not by two single-quote (''), and double-quote can't cause the problem. Eubulides (talk) 17:32, 5 June 2009 (UTC)
  Done. Martin (Smith609 – Talk) 21:56, 5 June 2009 (UTC)
Why can't we just use the more reliable <i> tag instead of the fancy MediaWiki single-quote syntax? —Remember the dot (talk) 01:33, 5 June 2009 (UTC)
Ah, I figured it out. It's so that you can toggle the italics automatically, for example "Critics Praise The Importance of Being Earnest, Call it a 'Smashing success'." Now that I understand that, I agree that your Template:Italictitle solution is probably the best we can do. —Remember the dot (talk) 02:22, 5 June 2009 (UTC)