Template talk:Doi

From Wikipedia, the free encyclopedia

Contents

[edit] Problem DOI

This DOI doesn't work in the template. I tried several character encodings. It's in Sea_level_rise#References. (SEWilco 03:01, 22 May 2005 (UTC))

10.1175/1520-0442(2002)015<0487:SOCASI>2.0.CO;2

This solution seems to work:

doi:10.1175/1520-0442(2002)015<0487:SOCASI>2.0.CO;2 10.1175/1520-0442(2002)015<0487:SOCASI>2.0.CO;2

The above is generated by:

{{doi|<nowiki>10.1175/1520-0442(2002)015<0487:SOCASI>2.0.CO;2</nowiki>}}

It may be a problem if the doi contains the string </nowiki>... Paolo Liberatore (Talk) 20:45, 29 November 2005 (UTC)

A DOI that is made specifically so that it doesn't work on wikipedia. That would be a sight! Ansell 03:32, 8 April 2006 (UTC)
Numerous DOIs using the <,>,[ and ] characters will notwork on these templates.I am not sure how to force them to display properly. Numericla entities do not appear to work. See also User:Circeus/Maple for two other examples. Circeus 14:48, 25 July 2006 (UTC)
My problematic DOIs are 10.2179/0008-7475(2004)069<0230:SN>2.0.CO;2 and 10.1656/1092-6194(2005)012[0023:SASEOA]2.0.CO;2 Circeus 14:55, 25 July 2006 (UTC)

It appears to be a MediaWiki bug, in that the character entity (which would be the correct way to do it) is terminating the link:

doi:<0487:SOCASI>2.0.CO;2 10.1175/1520-0442(2002)015<0487:SOCASI>2.0.CO;2

Using a URL escape works; however, since the same template parameter is also used for the display text, it does not display correctly:

doi:10.1175/1520-0442(2002)015%3C0487:SOCASI%3E2.0.CO;2

--cesarb 15:35, 25 July 2006 (UTC)

Guess that's going to be our solution for now. I'll list the escapes when I have some time. Circeus 17:26, 25 July 2006 (UTC)
See also [1], [2]. --Ligulem 23:17, 25 July 2006 (UTC)
Has this Mediawiki bug been reported?
For problem URLs, you could add another variable and have one variable for the displayed value and one for the percent-encoded value. — Omegatron 17:30, 11 August 2006 (UTC)

[edit] Add to template

Hi, this template is locked, so I thought I'd let someone know who has the permissions to add a bit of a "See also" section at the end:

==See also==
*[[Template:Doi-inline]]

Thanks.+mwtoews 22:40, 22 December 2006 (UTC)

The documentation page is not locked. It's at Template:Doi/doc. Feel free to edit that. It's transcluded into what you see on the template:Doi page (add "?action=purge" to the end of the address line in your browser if it's not updated after your edit). --Ligulem 23:47, 22 December 2006 (UTC)
Aha, that's cleaver. Thanks, that was new to me! Done.+mwtoews 07:10, 24 December 2006 (UTC)

[edit] URL encoding

Is there a good reason why you have two separate parameters instead of just using http://dx.doi.org/{{urlencode:{{{1}}}}}? — Omegatron 02:19, 18 February 2007 (UTC)

I think I tried and failed to get anything out of Template:Urlencode. Besides, by now, we risk breaking too many uses of the template without real benefits.Circeus 22:48, 19 February 2007 (UTC)
The problem is bug 9031: urlencode does not treat < and > properly. -- Jitse Niesen (talk) 10:36, 18 August 2007 (UTC)
This bug is fixed in newer MediaWiki versions (tried it today). In principle we could change the template. The documentation of urlencode templte states this, too: Help:Parser_function#URLENCODE. -- Thetaphi (talk) 19:30, 24 March 2008 (UTC)
haven't looked at this in a while. Can we fix it while remaining backwards-compatible? — Omegatron 23:29, 24 March 2008 (UTC)


[edit] delete this template

Doi have add interwiki map, plese use [[DOI:XXXX]]: DOI:10.1000/182.--Shizhao 13:00, 23 July 2007 (UTC)

Shouldn't that be http://dx.doi.org/10.1000/182 instead of http://www.doi.org/10.1000/182? Tizio 13:47, 23 July 2007 (UTC)
Never mind, I asked the folks on meta myself. Tizio 13:51, 23 July 2007 (UTC)
Have fix--Shizhao (talk) 08:45, 30 January 2008 (UTC)

So

Doesn't handle special cases:

[edit] Caps

Can we have the output of the template be "DOI:" instead of "doi:" ? This is to bring this template in line with the {{cite journal}} output. --Rifleman 82 04:26, 22 October 2007 (UTC)

This is not good. DOIs should generally be treated as URIs and URIs should spell the "protocol"-part in lowercase (e.g. http: ftp: hdl: doi: urn:). This was discussed on German wikipedia, too and the spelling was changed to lowercase. I am member of one of the non-crossref DOI-supplying organizations (http://www.std-doi.de) and we try to propse the URI notation of DOIs. Almost all publishers use doi:, examples from our field are: doi:10.1594/PANGAEA.55366, doi:10.1016/S0037-0738(99)00071-8. One example how to cite a DOI: How to cite with DOI @ Elsevier -- Thetaphi (talk) 13:05, 26 March 2008 (UTC)
By the way: {{cite journal}} was changed to lowercase long time ago! -- Thetaphi (talk) 13:15, 26 March 2008 (UTC)
Seems convincing, so I changed it back to use "doi:" . Thanks for your comment. -- Jitse Niesen (talk) 14:22, 26 March 2008 (UTC)

[edit] New #urlencode function

{{editprotected}}

With the new #urlencode parserfunction, there's now no need for the label parameter.

Please replace the contents of this page with those of Template:doi/editprotected.

This will automatically encode the DOI when generating a link address.

Smith609 Talk 12:54, 6 May 2008 (UTC)

Y Done -CapitalR (talk) 13:12, 6 May 2008 (UTC)
Wow, quick work! Thank you. Smith609 Talk 13:33, 6 May 2008 (UTC)

{{editprotected}}

Hi, another fix to broken links resulting from square brackets in DOI syntax. Again, please copy from Template:doi/editprotected (backlinks, edit).
Before fix: doi:[squarebracket/doi 10.1235/example[square]bracket/doi] ... doi:10.1038/nature145653
After fix: doi:10.1235/example[square]bracket/doi  ... doi:10.1038/nature145653
Y Done --CapitalR (talk) 10:41, 7 May 2008 (UTC)

[edit] Parenthesis?

The following DOI contains parentheses, and seems to fail to link properly:

doi:10.1016/S0140-6736(98)05145-9 10.1016/S0140-6736(98)05145-9

(The link is there, but it the text of the DOI isn't linked.) Where is the problem here? 13:20, 14 May 2008 (UTC)

I have the same problem with doi:10.1016/S0168-0072(99)00032-9, apparently all Elsevier DOIs are affected. I notice that deleting the slash also makes the problem disappear, so it is not necessarily related just to the parentheses. URL encoding does not help, and in fact, breaks the link: doi:10.1016%2FS0168-0072%2899%2900032-9. Character entities do not help either: doi:10.1016/S0168-0072(99)00032-9.

IIRC, the offending doi displayed OK two weaks ago, I thus strongly suspect that the bug is caused by one of the recent changes to the template. Can someone revert it to the working March 26 version, and properly debug it before making further sweeping changes? — EJ (talk) 15:59, 14 May 2008 (UTC)

I have reverted. The reason id/label was implemented was that, for some reason, the #urlencode simply did not work (I think there's a bug filed for it, actually). Hence the new form made the link practically invisible. Circeus (talk) 21:45, 10 June 2008 (UTC)
Thanks. — Emil J. (formerly EJ) 09:23, 11 June 2008 (UTC)

[edit] Parameter “label”

I don't understand what the parameter “label” is good for. The version without this parameter produces exactly the same link as the one with the parameter:

{{doi|id = 10.1175/1520-0442(2002)015<0487:SOCASI>2.0.CO;2}}

doi:10.1175/1520-0442(2002)015<0487:SOCASI>2.0.CO;2

{{doi | id = 10.1175/1520-0442(2002)015%3C0487:SOCASI%3E2.0.CO;2 | label = 10.1175/1520-0442(2002)015<0487:SOCASI>2.0.CO;2 }}

doi:10.1175/1520-0442(2002)015<0487:SOCASI>2.0.CO;2

Special characters (see old version of doc) have to be replaced in the parameter “id” anyway. --Leyo 22:11, 10 June 2008 (UTC)

At some points, it appears that the way urls are handled was changed at they now allow unescaped carets (I was not aware of this), which was not possible back in December/January. Any attempt to use the new format with brackets still broke the template, though, hence my revert. I'll just rewrite the current documentation to account for this. Circeus (talk) 23:28, 10 June 2008 (UTC)
Better now? Only square brackets require the id/label system.Circeus (talk) 23:32, 10 June 2008 (UTC)
Please have a look at the source code of my examples. Both types of brackets have to be replaced in the parameter “id” as shown here. Like this, the link is working and the link text is correct, even without using the parameter “label”. --Leyo 08:12, 11 June 2008 (UTC)
I looked at that and spent twenty minutes Monday fiddling and trying to figure out just what the heck was to be replaced by what in which parameters before giving up. Whatever one was supposed to do, the page was not clear enough about what it was. Circeus (talk) 17:25, 11 June 2008 (UTC)