Template talk:Google books

WT:CITE
RfC on whether WP:CITE should say Google Books page links are not required but are allowed in footnotes, and that editors should not go around removing them. All input welcome. SlimVirgin talk| contribs 20:35, 29 October 2010 (UTC)
 * Certainly should have links. — LlywelynII  02:09, 10 September 2011 (UTC)
 * I personally agree (at least as long as a preview is available and allows easy verification of related WP content), but not every author sees it that way. Another issue is Google does not guarantee that the book or the cited pages stay visible. In practice in many cases it is relatively stable, but not always and an additional drawback is that the visibility might depend on your country.--Kmhkmh (talk) 11:50, 10 September 2011 (UTC)

Template needs work
No space for author, year of publication, date of access/retrieval, etc. See WP:CITE/ES. — LlywelynII  02:09, 10 September 2011 (UTC)
 * Also no need to place obnoxious, distracting "at Google Books". Template already creates link. — LlywelynII  02:22, 10 September 2011 (UTC)

As I understand it the purpose of this template to merely provide a Google books link to a specific page and not to be (an often messy and much more comprehensive) citation template and to stay away from the "true citation (template)" wars. In other words this is not a citation template, but a template that allows people not using citation templates to provide useful (page based) online links nevertheless. For that reason imho there is no point in extending with your suggested entries, because for that we already have citation templates.

Where I would tentatively agree however is that the "at Google Books" part could be removed or at least made optional.--Kmhkmh (talk) 11:45, 10 September 2011 (UTC)


 * Compare it with Template:Gutenberg, which does allow full citations. Horatio (talk) 07:29, 28 April 2013 (UTC)

Emit page number
The template accepts a parameter page Should it then not also emit that page number? E. g.
 * History of the Western Insurrection, p. 42, at Google Books

I think the necessary template code would look like

but I'm not exactly a template expert. -- Michael Bednarek (talk) 12:45, 30 August 2012 (UTC)

Proposed changes in Template:Google books/sandbox and Template:Google books/testcases
Hi everyone, there are two changes I've made in the template sandbox. One displays the page number after the url if one was passed to the template; it was suggested by Michael Bednarek. The other is a result of the nomination of for merging&mdash;it allows this template to return only a bare url and nothing else (which is to replace gbook). Thanks, Rain City 471  (whack!) 08:11, 21 October 2013 (UTC)
 * Thanks; instead of surrounding the page number with parentheses, I prefer commas around it. -- Michael Bednarek (talk) 13:02, 21 October 2013 (UTC)
 * That's fine, it probably does look better that way. I'll copy the sandbox changes to the main template now.  Thanks, Rain City 471  (whack!) 19:59, 22 October 2013 (UTC)
 * These changes are causing URL errors to appear in citations where there were no errors before. See, for example: and . Please fix this problem if you are able. – Jonesey95 (talk) 03:37, 23 October 2013 (UTC)
 * If a plain URL is required, specifying yes (which needs to be documented) will do that. From your 1st example:
 * will produce
 * (1842) with F. H. Troschel
 * It seems to me that the previous use of Google books in your examples for the parameter url in the template Cite book was bending the concept of a URL quite a bit. -- Michael Bednarek (talk) 04:23, 23 October 2013 (UTC)
 * This change is indeed causing CS1 URL scheme errors. Ex: Gold standard. —  J J J   ( say hello ) 14:39, 25 October 2013 (UTC)


 * I guess I'm the person who mucked up... My understanding was that the template would never have worked in citation templates anyway, since it always returned the formatted url and I just added an option for it to return a plain one... Anyway shall I [//en.wikipedia.org/w/index.php?title=Template:Google_books&action=edit&undoafter=577475949&undo=578310444 undo it]? Rain City 471  (whack!) 18:21, 25 October 2013 (UTC)


 * No, this does not need to be reverted. I was worried that there would be tons of google books templates in citations, but the job queue appears to be adding them to at a rate of only about one or two a day, which is easy to keep up with. – Jonesey95 (talk) 21:51, 25 October 2013 (UTC)


 * Ok, I'm afraid i don't know why the job queue is doing this. I guessed I was safe because I thought the template would never have worked in citation templates anyway; I considered all I was doing was adding an option to change the output and it wouldn't affect the default (this is disregarding the change that added the page number; that only added to the title and can't have affected this). It was my fault I forgot to document the change&mdash;I sort of remembered a bit later and then forgot. If for some reason the job queue spits out a load of broken templates, ask me and I'll be happy to help. Sorry, Rain City 471 (whack!) 22:39, 26 October 2013 (UTC)


 * The job queue is a background process that, among other things, recategorizes articles when one of the templates contained ("transcluded", in WP jargon) within the article causes that article to be added to or removed from a category. The job queue effectively performs a null edit on each article, "refreshing" it. It appears to be taking 3-4 weeks to travel through all of Wikipedia these days, so if it adds one or two a day, that means about 30-40 articles will pop up with errors. That's not a problem; human editors create a lot more problems than that.


 * Is somebody here going to change the 10 or so articles that use gbook to use this template instead? – Jonesey95 (talk) 23:30, 26 October 2013 (UTC)
 * I understand about the job queue and will try and sort the gbooks soon. Rain City 471  (whack!) 21:41, 2 November 2013 (UTC)

How to deal with "roman" page numbers and front matter?
If instead of using  one uses   this will link to pages number using roman numerals. Also, I just found you can even use  for pages before the roman numerals start. Taking the example from the template documentation: yields However, if one links to //books.google.com/books?id=7ydCAAAAIAAJ&pg=PP2, this is the bookplate on the inside cover, and //books.google.com/books?id=7ydCAAAAIAAJ&pg=PR1 is the title page complete with inscriptions. What would be the best way to incorporate these modes of use into the template? —Phil | Talk 12:58, 21 May 2014 (UTC)

keywords
Can we add a keyword search parameter? I want to generate a URL something like
 * https://books.google.com/books?id=3rREAAAAYAAJ&q=cumana+landcruiser

I am a professional programmer who is used to WP templates, so I don't mind doing the work myself.  Stepho  talk 02:12, 26 August 2015 (UTC)
 * (using text)
 * (using keywords)
 * User:Stepho-wrs, added keywords. it looks like there is already an undocumented text. not sure if that does anything useful. Frietjes (talk) 13:07, 12 September 2015 (UTC)
 * text emits  which works for searching a "direct quote". I have added it to the documentation. HTH HAND —Phil | Talk 13:00, 29 April 2016 (UTC)

Should ignore spaces
Most templates ignore spaces before the "|" when specifying parameters, but this template does not. When I enter  the URL generated has a space before   which is an invalid URL. It causes further problems when using the template within another template after the parameter. Can someone fix the template to ignore extra spaces within the generated URL? Thanks. Curious Eric  20:10, 15 October 2017 (UTC)
 * I have adjusted the template to trim whitespace from the id. Here's what it looks like now:.


 * Let me know if I have broken anything. – Jonesey95 (talk) 20:50, 15 October 2017 (UTC)
 * P.S. I tried in the sandbox to elegantly trim whitespace from the whole URL, but it doesn't work for me. – Jonesey95 (talk) 20:58, 15 October 2017 (UTC)


 * Triming the whitespace seems to work fine now in the mainline template, both before and after the "|". I am not familiar with testing in the sandbox.   Curious  Eric  01:41, 16 October 2017 (UTC)

Two-page
Needs to support two-page view. Google Books param is "v=twopage" Mikus (talk) 21:37, 27 September 2019 (UTC)

Google 'dq' parameter is not the quoted phrase search
An error in the documentation «  searches for a quoted phrase (corresponding to the dq parameter in the Google URL) ». That's not true. The Google Book URL's dq parameter is a mystery, not explained in the Google API documentation or any other part. Testing with a few URL, I suppose that dq is something like a « direct search » (from Google Search or Google Books main page) as opposed to q modified by the search formular of a preview (javascript).

The "quoted search" works with quotes in URL : as in. Same as Google Search. So the template text param may have to generate an URL with  or   (but not dq=bla).

Irønie (talk) 12:16, 26 March 2020 (UTC)

Google book tool erroring out
The Google book tool link provided in the template's documentation leads only to an error page, for me: Error: Server Error The server encountered an error and could not complete your request. Please try again in 30 seconds. I will try again, as suggested, but my hopes are not high. (Correctly, as it turns out, because a reload after ~60 seconds produced the same message.) Though, the error page does still have a favicon that would seem to represent the tool in question.

For others who have more experience with the tool, is this a common issue with it? Are outages temporary, or likely to be longer-term? Should the link be removed from the documentation? (And in the foolish-optimism department: Does anyone have any replacement links to similar, but currently functioning, tools?)

I now see that appspot.com itself redirects to the Google Cloud Platform management console, which makes me even more concerned that the tool previously available at reftag.appspot.com is gone forever. FeRDNYC (talk) 08:28, 14 January 2022 (UTC)
 * Never mind — Citer, developed by Dalba, is a much better tool that accepts more types of URLs/identifiers, and it runs on the Wikimedia toolforge. I'll update the template docs to point there instead. FeRDNYC (talk) 09:34, 14 January 2022 (UTC)