Misplaced Pages

Template talk:Cite ODNB

Article snapshot taken from Wikipedia with creative commons attribution-sharealike license. Give it a read and then ask your questions in the chat. We can research this topic together.

This is an old revision of this page, as edited by Carcharoth (talk | contribs) at 21:54, 22 January 2012 (Alternative sandbox implementation and changes: comment). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

Revision as of 21:54, 22 January 2012 by Carcharoth (talk | contribs) (Alternative sandbox implementation and changes: comment)(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)

The leading bullet

The leading bullet here seems non-standard, and a bit awkward for use in footnotes. I'd like to remove it before matters go further. Charles Matthews (talk) 08:36, 8 November 2010 (UTC)

yes, definitely agree. Dsp13 (talk) 09:39, 8 November 2010 (UTC)
agree that it should be done, anyway. If it is removed early will the 8K pages using it at present need to be repaired before doing anything else? Dsp13 (talk) 09:41, 8 November 2010 (UTC)

It's not on 8,000 pages! Currently fewer than 100 occurrences by what links to the template page. So it's manageable by hand right now. Charles Matthews (talk) 13:28, 8 November 2010 (UTC)

pleased to hear I'd got my wires crossed!Dsp13 (talk) 20:14, 8 November 2010 (UTC)

Done, and I've made a pass through all the places where the template is used. Charles Matthews (talk) 08:24, 10 November 2010 (UTC)

Links broken?

When I use the template it creates the text perfectly fine, as well as links to the ODNB's WP article and the library subscription page on the external ODNB site. But the main link just points to http://dx.doi.org/10.1093/ref:odnb/default which brings up a 404 page on the DOI website. No matter what is in the template it still seems to point to this URL. (see John Perry (engineer) for a recent example of usage).

Any idea what might be wrong? or have I made an error in usage? The link for the particlar article should point to http://www.oxforddnb.com/view/article/39459. Fattonyni (talk) 13:34, 18 January 2011 (UTC)

You can't omit the names of the fields; I have fixed that example. Charles Matthews (talk) 13:40, 18 January 2011 (UTC)

Documentation

The documentation on this appears to be out of date as using the example it does not work. Keith D (talk) 01:51, 22 February 2011 (UTC)

I've partially fixed the documentation now. Charles Matthews (talk) 20:13, 22 February 2011 (UTC)
Thanks. I will look again at using it. Keith D (talk) 21:33, 22 February 2011 (UTC)

ODNB citation style

I've raised some issues with this template at Misplaced Pages talk:Citing sources#ODNB citation style. To briefly summarise what I said there, I'd like to see this template actually crediting the authors of the articles cited (that would be ethical) and to end up with a format like that seen here. Probably best discussed there, but if discussed here, please leave a note at the other discussion location as well. Carcharoth (talk) 23:44, 13 October 2011 (UTC)

Now in sandbox:

ODNBweb

{{ODNBweb |doi=10.1093/ref:odnb/34601 |last=Stocker |first=Mark |month=September |year=2004
|title=Louise, Princess, duchess of Argyll (1848–1939) |publisher=] |edition=online, January 2008 |accessdate=23 January 2008 |id=34601 |ref={{sfnRef|Stocker 2004, Louise, Princess, duchess of Argyll}}}}
Stocker, Mark (2004). "Louise, Princess, duchess of Argyll (1848–1939)". Oxford Dictionary of National Biography (online, January 2008 ed.). Oxford University Press. doi:10.1093/ref:odnb/34601. {{cite encyclopedia}}: |access-date= requires |url= (help); Unknown parameter |month= ignored (help) (Subscription or UK public library membership required.)

Cite doi

{{Cite doi/10.1093.2Fref:odnb.2F34601}}
Template:Cite doi/10.1093.2Fref:odnb.2F34601

ODNBweb/sandbox

{{ODNBweb/sandbox |doi=10.1093/ref:odnb/34601 |last=Stocker |first=Mark |month=September |year=2004
|title=Louise, Princess, duchess of Argyll (1848–1939) |publisher=] |edition=online, January 2008 |accessdate=23 January 2008 |id=34601 |ref={{sfnRef|Stocker 2004, Louise, Princess, duchess of Argyll}}}}
Stocker, Mark (2004). "Louise, Princess, duchess of Argyll (1848–1939)". Oxford Dictionary of National Biography (online, January 2008 ed.). Oxford University Press. doi:10.1093/ref:odnb/34601. {{cite encyclopedia}}: |access-date= requires |url= (help); Unknown parameter |month= ignored (help) (Subscription or UK public library membership required.)

---— Gadget850 (Ed)  09:39, 14 October 2011 (UTC)

Many thanks for that. I'm not quite sure how the bots that fill in citations work, but I assume the above would have to be filled in by hand rather than bots doing it? Back at the other discussion (that I linked above) you said that 'cite doi' draws on 'cite journal', and I pointed out that 'cite encyclopedia' fits better. Does the above incorporate 'cite encyclopedia', or is it a template purely designed to replicate the ODNB-preferred citation style, with the 'subscription needed' details added? The other issues that sometimes come up with citing to the ODNB:
  • People outside the UK sometimes access library volumes of the 2004 print edition, citing page numbers. Can that be incorporated somehow, along with a courtesy link to the current online version of the article, though that may be less desirable as it may be different from the initially published 2004 version of any particular article (see below). Also, as this template is named "ODNBweb" it makes less sense to incorporate page numbers from the print edition (future updates are, I think, intended to be entirely online).
  • The online entries are updated periodically (around three times a year, I think). This is not all the entries, but a rolling program of updates. Also, new entries are also added that were written after the 2004 edition. The online versions are the most current ones (though sometimes with no actual changes made, presumably the update is to tell the reader that the article was checked even if not updated), but links are also provided to the previous versions of the articles (a typical example would be an initial version in 2004, a new version in 2008, and the latest version in 2011). The point here is that the version accessed online may vary from the one initially cited. What is the best way to handle this, and is there a way to make it easy for editors to update to the latest version if they verify that it still supports the material cited? Also, the author citation may change as extensive revisions bring in the new author and co-credits them and the initial author.
Thanks for doing this, and I hope the above isn't too complicated to consider. Carcharoth (talk) 07:04, 15 October 2011 (UTC)
  • {{Cite doi}} uses {{cite journal}} which in turn uses {{citation/core}}. The current {{ODNBweb}} uses {{citation}} which uses {{citation/core}}. The sandbox version uses {{citation/core}} directly. The key is that they all give the same output. I did class it as 'encyclopedia' so that will show up in metadata.
  • There is no guarantee that the print and online versions are the same. You need to cite the version that you actually read. We could have a variant for the print version but it needs to be a separate citation.
  • If the online version is updated, you will have to manually update the citation. Since this site requires a subscription, a bot cannot do the updates.
---— Gadget850 (Ed)  11:39, 15 October 2011 (UTC)
Many thanks for explaining all that. That also answers my question about the hundreds of uses of the template, which would have to be manually updated. Though I think some of the data can be accessed without a subscription? i.e. There is a public page for each entry that doesn't require a subscription (you can see this by following the links above). Maybe you are only referring to the edition date as needed a manual update, but I think that public page has that information anyway - the distinction will be between the most up-to-date page (which the doi link will presumably take you to anyway, and the access date). Anyway, I'm very happy with the sandbox version you have produced here. If it goes live, I presume it won't break any existing use, but will allow for addition of more citation information. I would like to get more input before any switch, though, so will leave notes with the three editors who have edited it most. Carcharoth (talk) 03:24, 16 October 2011 (UTC)
Thank you for inviting me to this conversation. I have had a look quick at the template in the sandbox (Template:ODNBweb/sandbox) and I think you may be making a mistake. My initial thoughts are that it would be better to call {{cite encyclopedia}} from this template, otherwise AFAICT there is a large maintenance overhead. I am open persuasion that that is not so. -- PBS (talk) 06:15, 16 October 2011 (UTC)
So future editors would find it easier to edit a template based on {{cite encyclopedia}} (which calls {{citation/core}}) than to edit a template based on {{citation/core}} directly? ---— Gadget850 (Ed)  12:53, 16 October 2011 (UTC)

If we could just go back a bit: some of the features requested actually exist in the current {{ODNBweb}}, and have done so for some time? In particular authors, and access date. Charles Matthews (talk) 17:29, 16 October 2011 (UTC)

Hmm. Yes. The documentation never got updated (I've just tried to do this, but the parameters confuse me so I stopped). FWIW, I agree with PBS (and said so somewhere above and here) that cite encyclopedia makes more sense. However, it depends on whether you want to cite the ODNB using a hybrid Misplaced Pages style, or cite the ODNB using something closely approximating the style they suggest on their site. What are the main options here? Carcharoth (talk) 17:34, 16 October 2011 (UTC)

I am a bit confused. The sandbox version is using encyclopedia, it is just using it directly instead of using {{cite encyclopedia}} as an intermediate template. Perhaps this will help:

Current
{{ODNBweb}} → {{citation}} → {{citation/core}}
Sandbox
{{ODNBweb}} → {{citation/core}}
Discussed
{{ODNBweb}} → {{cite encyclopedia}} → {{citation/core}}

I can switch it to {{cite encyclopedia}}, but the output will be exactly the same. ---— Gadget850 (Ed)  18:12, 16 October 2011 (UTC)

I had a brief look at the code in Template:ODNBweb/sandbox, and it might be confusing matters that you have 'Title=Oxford Dictionary of National Biography' along with a title parameter being used for the article title. In contrast, those used to using Template:Cite encyclopedia will be familiar with using 'title' for the title of the article and 'encyclopedia' for the name of the encyclopedia. Is this a leftover from the way the template structures evolved separately and then merged later when citation/core was developed? (I do realise that as this is an ODNB-specific template, there is no real need to specify or have a named parameter for the name of the 'encyclopedia', other than for metadata purposes, but it might be causing some of the confusion here). Carcharoth (talk) 22:47, 16 October 2011 (UTC)
How citation/core works

I am splitting this so we don't get too off track. When you examine the markup for a template like this one or {{cite encyclopedia}}, the parameters in upper case (for the most part) are from {{citation/core}}. Lets examine some parameters:

Here |Title= and |title= are separate parameters. Citation/code describes |Title== Title, to be displayed in italics after |IncludedWorkTitle=. This is the title of the main work.

cite encyclopedia
|Title={{{encyclopedia|{{{title|}}}}}}
You can use either |encyclopedia= or |title= to feed into citation/code. (There is something odd about how cite encyclopedia uses this, but lets get past that for the moment).
ODNBweb/sandbox
| Title=]
And here the title is fixed to the ODNB.

From citation/core: |IncludedWorkTitle= Specific title, to be displayed in quotation marks. This is the title of an included work, such as a chapter or encyclopedia entry.

cite encyclopedia
|IncludedWorkTitle = {{{title|{{{article|}}}}}}
ODNBweb/sandbox
| IncludedWorkTitle={{{title|{{{article|{{PAGENAME}}}}}}}}
Both use |title= or |article= to pass the entry; ODNBweb will use the page name by default.


Now, lets compare three different templates:

Cite doi (which uses cite journal)

Template:Cite doi/10.1093.2Fref:odnb.2F34601

ODNBweb/sandbox

Stocker, Mark (2004). "Louise, Princess, duchess of Argyll (1848–1939)". Oxford Dictionary of National Biography (online, January 2008 ed.). Oxford University Press. doi:10.1093/ref:odnb/34601. {{cite encyclopedia}}: |access-date= requires |url= (help); Unknown parameter |month= ignored (help) (Subscription or UK public library membership required.)

cite encyclopedia

Stocker, Mark (2004). "Louise, Princess, duchess of Argyll (1848–1939)". Oxford Dictionary of National Biography (online, January 2008 ed.). Oxford University Press. doi:10.1093/ref:odnb/34601. Retrieved 23 January 2008. {{cite encyclopedia}}: Unknown parameter |month= ignored (help)

Notice they all have the same outputs, except for the ODNBweb subscription notice. If you check the metadata, they will all be the same. ---— Gadget850 (Ed)  23:20, 16 October 2011 (UTC)

Thank-you. That makes things a little bit clearer for me. I've also previewed the same thing using the ODNBweb template, to see the difference with what is currently available. I do still have questions about how current usage of the template would be updated and how future use would be handled, but I'll wait on that until we are all on the same page here and PBS and Charles have had a chance to reply. Carcharoth (talk) 23:48, 16 October 2011 (UTC)
I can hand write an output line to look just like the output of any of those templates. The trouble with that is when someone changes the output look of the template, if my line is to remain looking the same as those that use the template, I have to redo the output line (and I will have to do that every time the template is altered). In my opinion this template should end up looking like {{cite encyclopedia}} (and tacking on the subscription bit at the end). All this template should be doing is filling in some of the fields for the person who would otherwise use {{cite encyclopedia}}. If it calls {{cite encyclopedia}} then maintenance is simplified. If it mimics/duplicates the internal workings of {{cite encyclopedia}} then one is doubling up the maintenance effort required because any change to {{cite encyclopedia}} has to be replicated here. Now in the short term that may be acceptable, but it is an unnecessary burden to place on future editors if we can design the interface in such a way that much of the maintenance is automatic. -- PBS (talk) 01:46, 17 October 2011 (UTC)
Updated to {{cite encyclopedia}} with no change in visual or metadata output. ---— Gadget850 (Ed)  07:53, 17 October 2011 (UTC)
If that has been resolved, could we discuss how existing uses of this template could be updated with extra citation information? And what about other citations to this publication done by hand? I was reading Geoffrey (archbishop of York) today, and that is a good example of the citation filled out by hand in a way that is almost (but not quite) like the way you did above. Is that a different style, or the same style but with bits missing? Carcharoth (talk) 00:44, 19 October 2011 (UTC)
What extra fields are required?
That article uses a mix of standard Help:Footnotes and Shortened footnotes with a mix of manual citations and Citation Style 1. For example:
<ref name=DNB>Lovatt "" ''Oxford Dictionary of National Biography''</ref>
{{cite encyclopedia |author=Lovatt, Marie |title=Geoffrey (1151?–1212)|encyclopedia=Oxford Dictionary of National Biography |publisher= Oxford University Press |year= 2004 |url=http://www.oxforddnb.com/view/article/10535 |edition= October 2007 revised |accessdate= 12 November 2007 |doi= 10.1093/ref:odnb/10535 |format= {{ODNBsub}} }}
So, it could use some cleanup there. ---— Gadget850 (Ed)  01:30, 19 October 2011 (UTC)
I wasn't saying extra fields are required, I was enquiring as to the best way to add (e.g. author information) to existing uses of this template. For example: Cyril Burt, Thomas Girtin, Henry Every. In practice, how would the extra citation information (where it is missing) be added to those uses of this template, if your sandbox was implemented? Carcharoth (talk) 01:44, 19 October 2011 (UTC)
You would have to manually update these entries. You can look at getting a bot to do this, but that isn't one of my skills. ---— Gadget850 (Ed)  12:00, 19 October 2011 (UTC)

Looking at what is in the sandbox and I assume that is the code we are discussing. If so there are two settings for "|ref=". It seems to me that a lot of the code can be removed. I do not see the reason for the year complications or the date stuff. Why not just pass those complications on to encyclopedia to sort out?

On that note to protect this template from causing problems due to bugs in the encyclopedia template (it does not handle the difference between null and empty parameters very well) you might like to consider setting parameters like this fragment of code:

 <!--Test below stops the setting of an empty named
     parameter not explicitly passed into this template-->
 |{{#if:{{{year|}}} |year  |HIDE_PARAMETER}}={{{year|}}}
 |{{#if:{{{date|}}} |date  |HIDE_PARAMETER}}={{{date|}}}

--PBS (talk) 05:10, 19 October 2011 (UTC)

Thanks for catching that; markup now cleaned up. I don't understand the issue with null/empty; please provide an example. Is there someplace where your sample markup is used? Using a value like {{{year|}}} ensures that only a non-empty value is parsed. ---— Gadget850 (Ed)  12:00, 19 October 2011 (UTC)

This was one that bit me earlier in the year. I was (still am?) setting up pairs of templates for PD sources. One is typically called {{Cite PDpedia}} and the other {{PDpedia}}. Usually {{Cite PDpedia}} is like this template and serves the same function see for example {{cite EB1911}} they both add hidden categories for maintenance. The "cite" template of the two would work as expected but when called via another template would fail in what was for me at the time unexpected ways.

A demonstration

This can be demonstrated using {{cite encyclopedia}}: Empty citation (help) which has this "feature" in its design. If you create a test template in a sandbox in your user area eg User: Gadget850/test and put in some code like this:

{{cite encyclopedia 
|title= {{{title|}}}
|encyclopedia=PD Old
|last= {{{last|}}}
|author= {{{author|}}}
}}

Now for some some tests: First using the parameter "last":

{{User: Gadget850/test|last=ASMITH|title=An article}}
{{cite encyclopedia|last=BSMITH|title=An article|encyclopedia=PD Old}}

The code works as expected. Now for some tests using the parameter "author":

{{User: Gadget850/test|author=CSMITH|title=an article}}
{{cite encyclopedia|author=DSMITH|title=A title|encyclopedia=PD Old}}

The author parameter value "CSMITH" is missing from test output but DSMITH is present in encyclopedia output. Why? Because in test we are passing in "last=" as an empty string (thanks to the line in the "user/test" template "|last= {{{last|}}}"). The problem lies in the mal-formed line in {{cite encyclopedia}} that does not test the parameter "last" to see if it is empty it only tests to see if it exists. If it exists then it uses it (even though it is empty) and ignore the rest of the line so the output generated by test calling encycloped is that of last="" rather than author="CSMITH".

At the time (last March) I was baffled and had to ask a question at Help talk:Template where some patient people explained the error of my ways. Once I knew what to look for I came across this:

Which explain it.

The point I was making is that it is probably not a good idea to pass in parameters from one template to another that are not set by application page, because even if the template that is called (in this case {{cite encyclopedia}} works as expected today when called from a wrapper template (this one), it may not work properly tomorrow. The reason I highlighted "year=" and "date=" is because they are used by {{harv}} and if date= is present, year= is not displayed, but if year= is present then {{harv}} uses its value even if date= is set. So to avoid possible unforeseen consequences, it is probably best not to set either to blank in this wrapper template if the application page using it does not explicitly set them. -- PBS (talk) 23:11, 20 October 2011 (UTC)

I still don't see it. If this were an issue, it would be well known and documented. I have dealt with many templates and never seen where a null value is passed as you describe. See the samples in User:Gadget850/t8 using {{ODNBweb/sandbox}}. The first includes all parameters with no values, the second fills all values. Looking at the HTML output, the first does not include any of the undefined values in either the regular HTML nor the COinS metadata.
I suggest you try the code I placed above. -- PBS (talk) 10:33, 21 October 2011 (UTC)
The third uses date and year and produces the expected harv ref, as does the fourth using only the year. You are welcome to add an example illustrating the issues, especially if you can illustrate how {{ODNBweb/sandbox}} fails in either manner. ---— Gadget850 (Ed)  00:45, 21 October 2011 (UTC)
{{citation/core}} uses Year else Date else nothing, so if you provide both only year is parsed for the ref id. ---— Gadget850 (Ed)  03:51, 21 October 2011 (UTC)
I suggested that you created the template and try the above because it would become self evident.
examples
The reason why the template {{ODNBweb/sandbox}} works as expected is because you have lifted some of the logic out of {{cite encyclopedia}} for example you have to near replicate the the line
  • | last={{{last|{{{last1|{{{author|{{{author1|{{{authors|}}}}}}}}}}}}}}}
  • |Surname1 = {{{last|{{{surname|{{{last1|{{{surname1|{{{author1|{{{author|{{{authors|}}}}}}}}}}}}}}}}}}}}}
But to do that you have to go and look into the workings of encyclopedia and duplicate the logic found there, and if someone writes a template that calls {{ODNBweb/sandbox}} if they use the same method they will have to duplicate the same logic or it will fail. So one is then left with the problem that when the logic is changed low down chain, all the calling templates in the stack also have to be changed to remain compatible. If someone does not look at the logic of the underlying template and replicate it (or "fix" it in another way) and implements as simple template to call another (which is the reasonable thing to do) then it fails because with no knowledge of the inner workings of {{ODNBweb/sandbox}} it can not work:
        {{ODNBweb/sandbox 
         |last=   {{{last|}}}
         |author= {{{author|}}}
        }}
I have placed it in user:PBS/test3struck out as I may alter the content of the template PBS (talk) 08:50, 24 November 2011 (UTC) . I am calling it twice once with last=LAST and then again with author=AUTHOR. The second time around it fails to work as expected because although no value is passed into last=, last is initiated in test3, so the logic in ODNBweb/sandbox passes on an empty setting of last="" to {{tl|cite encyclopedia}] and never gets to test if author has a value.
If the line in the test template
        |last=   {{{last|}}}
is replaced with (see user:PBS/test25struck out as I may alter the content of the template PBS (talk) 08:50, 24 November 2011 (UTC))
        |{{#if:{{{last|}}} |last  |HIDE_PARAMETER}}={{{last|}}}
etc. The the template work like one would expect:
Simples! -- PBS (talk) 10:33, 21 October 2011 (UTC)
I am sure that there is something to this, but it is not an issue with these templates. I feel my work is done here, and I see no further issues. If you have fixes you wish to apply, then go ahead. Simply copy the sandbox to the current template when done. ---— Gadget850 (Ed)  12:09, 21 October 2011 (UTC)

Alternative sandbox implementation and changes

I reverted this change to the sandbox made on 26 October 2011. This revert changed underlying template back to {{cite encyclopedia}} from {{citation/core}}.

I then added a new parameter "origyear=" because in many instances the original 2004 version has been updated since and the editors at the ODNB promise a rolling update of their articles.

Having done that I put in a simple test into testcases. Everything seemed to work as expected. But a lot more test cases are needed.

Then I implemented a large change to the sandbox. As discussed in the previous section, I changed the way parameters were handled only passing on to {{cite encyclopedia}} those parameters that are set by editors who places this template into an article. This means that there is no need to handle any interrelation between the parameters in this template unless they are none standard. This should reduce maintenance on this template. Two parameters are handled in a none standard way:

There are two none standard parameters "id" and "urlname" if either or both are set they set a value for

Charles it was you who originally created this logic, with contribution-url=http://www.oxforddnb.com/view/article/{{{id|{{{urlname|default}}}}}}.htm What was the idea behind the "default" part because as it was implemented in the sandbox before my change it defaulted to an error page, as does the page generated by the current production version http://www.oxforddnb.com/view/article/default. If however it is left out then the string would be http://www.oxforddnb.com/view/article/ and that url automatically redirects to the home page. So whichever version is implemented the "default" needs to be removed. In my most recent version I have not implemented the logic for always supplying a string to "chapter-url=". The reason for this, is that if one uses the "doi=" parameter then I see no reason to set the other. However if it is wanted it is not difficult to do particularly if we remove "urlname". As the "urlname" parameter as it is not documented I suggest we remove it.

In the sandbox version I replaced there were three parameters not used by "cite encyclopedia": "author1link=" "author2link=" "author2link=" so IMO which ever version is implemented these can be removed.

Both the sandbox version I have just overwritten and my current implementation does not include the string "on the website of the" is that a feature that is wanted?

-- PBS (talk) 00:32, 6 November 2011 (UTC)

So what I did is mentioned on WT:WP DNB#Census right at the end: I just copied in from what is now Template:SpringerEOM some relevant bits. I'm not really competent to enter these template discussions at a technical level. Charles Matthews (talk) 22:24, 13 November 2011 (UTC)
It is not so much the technical level but the look of it. Do we drop the "on the website of the"
I now know what the default is used for, in other templates. If it is set then it hides the real name behind a façade of whatever default=name' is. ---PBS (talk)
Judging by how the ODNB self-describes , it would be more accurate to say "in the online edition of the". Charles Matthews (talk) 16:13, 14 November 2011 (UTC)
I agree that "in the online edition of the" would be more accurate. And a brief aside to PBS: it is 'non-standard', not 'none-standard'. I was intending to use this template in an article, but as the year and publisher parameters don't seem to be working (I used them both but no output was produced), I've going to use 'cite encyclopedia' directly as in noe of the examples above. Hopefully someone can get this template to produce what is needed. Is it all in a sandbox at the moment? Carcharoth (talk) 21:54, 22 January 2012 (UTC)