Template:Google books/doc: Difference between revisions
mention new |plain-url alias |
DocWatson42 (talk | contribs) m Performed minor cleanup. |
||
(34 intermediate revisions by 20 users not shown) | |||
Line 1: | Line 1: | ||
{{Documentation subpage}} |
{{Documentation subpage}} |
||
{{High-use|7351}} |
|||
<!-- PLEASE ADD CATEGORIES |
<!-- PLEASE ADD CATEGORIES AT THE BOTTOM OF THIS PAGE --> |
||
== Usage == |
== Usage == |
||
<code><nowiki>{{Google books| |
<code><nowiki>{{Google books|id|title|page=|keywords=|text=|plainurl=}}</nowiki></code> |
||
The <code>page</code>, <code>keywords</code>, <code>text</code>, and <code>plainurl</code> parameters are all optional. |
|||
The page number is optional. |
|||
The {{para|id}} parameter is the string of twelve characters found in the specific Google Books URL after "id=" but before "&". |
|||
⚫ | |||
The {{para|title}} parameter is used to specify the publication title when used as a link (and not as a bare URL; {{para|title}} is not useful when {{para|plainurl}} is used). |
|||
The {{para|page}} parameter may be used to link to a particular 'normal' page (i.e. PA24). {{para|pg}} can be used for 'special' pages |
|||
* Normal pages, e.g. {{para|pg|PA5}} for [[Arabic numeral|normal page]] 5. This is equivalent to {{para|page|5}} |
|||
* Roman pages, e.g. {{para|pg|PR5}} for [[Roman numeral|roman page]] v |
|||
* preamble pages, e.g. {{para|pg|PP5}} for preamble page 5 (often not officially numbered, scheme varies from book to book) |
|||
* e-book pages, e.g. {{para|pg|PT5}}, for the fifth page of an e-book (often not officially numbered) |
|||
If the page is prefaced with RA-, that can usually be removed. |
|||
The {{para|keywords}} parameter may be used to search for particular keywords within the text (corresponding to the ''q'' parameter in the Google URL); {{para|text}} searches for a quoted phrase (corresponding to the ''dq'' parameter in the Google URL). Only one of these should be used. |
|||
⚫ | |||
In many cases when converting an existing Google Books URL, only one of the above should be used. When multiple parameters are present, the final target page is much more likely to vary over time. If linking to a specific page, only use the page parameter, and if doing a text search then do not include the page parameter. The desired parameters are often the ones after the # symbol, since GB uses javascript. |
|||
For external links, the following all do the same thing: |
|||
*{{tnull|{{BASEPAGENAME}}|id{{=}}{{var|id}}|title{{=}}{{var|title}}}} |
|||
*{{tnull|{{BASEPAGENAME}}|1{{=}}{{var|id}}|2{{=}}{{var|title}}}} |
|||
*{{tnull|{{BASEPAGENAME}}|{{var|id}}|{{var|title}}}} |
|||
For URLs, the following all do the same thing: |
|||
*{{tnull|{{BASEPAGENAME}}|id{{=}}{{var|id}}|plainurl{{=}}yes}} |
|||
*{{tnull|{{BASEPAGENAME}}|1{{=}}{{var|id}}|plainurl{{=}}yes}} |
|||
*{{tnull|{{BASEPAGENAME}}|{{var|id}}|plainurl{{=}}yes}} |
|||
'''Example 1:''' |
'''Example 1:''' |
||
:<code><nowiki> |
:<code><nowiki>Brackenridge, H. M. {{Google books|7ydCAAAAIAAJ|History of the Western Insurrection}}</nowiki></code> |
||
creates |
creates |
||
: |
:Brackenridge, H. M. {{Google books|7ydCAAAAIAAJ|History of the Western Insurrection}}. |
||
'''Example 2:''' |
'''Example 2:''' |
||
:<code><nowiki>{{ |
:<code><nowiki>Brackenridge, H. M. {{Google books|7ydCAAAAIAAJ|History of the Western Insurrection|keywords=blood}}</nowiki></code> |
||
creates |
creates |
||
:{{ |
:Brackenridge, H. M. {{Google books|7ydCAAAAIAAJ|History of the Western Insurrection|keywords=blood}}. |
||
'''Example 3:''' |
|||
:<code><nowiki>Brackenridge, H. M. {{Google books|7ydCAAAAIAAJ|History of the Western Insurrection|page=42}}</nowiki></code> |
|||
creates |
|||
:Brackenridge, H. M. {{Google books|7ydCAAAAIAAJ|History of the Western Insurrection|page=42}}. |
|||
'''Example 4:''' |
|||
:<code><nowiki>{{cite book|last=Brackenridge|first=H.M.|title=History of the Western Insurrection|url={{Google books|7ydCAAAAIAAJ|page=42|plainurl=yes}}|page=42}}</nowiki></code> |
|||
creates |
|||
:{{cite book|last=Brackenridge|first=H.M.|title=History of the Western Insurrection|url={{Google books|7ydCAAAAIAAJ|page=42|plainurl=yes}}|page=42}} |
|||
'''Example 5:''' |
|||
:<code><nowiki>Brackenridge, H. M. {{Google books|7ydCAAAAIAAJ|History of the Western Insurrection|page=42|text=Perhaps bloodshed might have been avoided.}}</nowiki></code> |
|||
creates |
|||
:Brackenridge, H. M. {{Google books|7ydCAAAAIAAJ|History of the Western Insurrection|page=42|text=Perhaps bloodshed might have been avoided.}}. |
|||
'''Example 6:''' |
|||
:<code><nowiki>Brackenridge, H. M. {{Google books|7ydCAAAAIAAJ|History of the Western Insurrection|pg=PP2}}</nowiki></code> |
|||
creates this which links to the bookplate on the inside cover |
|||
:Brackenridge, H. M. {{Google books|7ydCAAAAIAAJ|History of the Western Insurrection|pg=PP2}}. |
|||
'''Example 7:''' |
|||
:<code><nowiki>Brackenridge, H. M. {{Google books|7ydCAAAAIAAJ|History of the Western Insurrection|pg=PR1}}</nowiki></code> |
|||
creates this which links to the title page complete with inscriptions |
|||
:Brackenridge, H. M. {{Google books|7ydCAAAAIAAJ|History of the Western Insurrection|pg=PR1}}. |
|||
== See also == |
|||
{{Wikidata property|P675}} |
|||
* {{tl|Google Books URL}} |
|||
* {{tl|Cite book}} |
|||
* [[Google Books]] |
|||
⚫ | |||
== Further research == |
|||
* {{cite web |title=Static Links |url=https://developers.google.com/books/docs/static-links |department=Google Books APIs |website=Google Developers |accessdate=2019-07-23}} |
|||
⚫ | |||
* {{cite web |title=Linking to individual titles on Google Books |url=https://support.google.com/books/partner/answer/3474239 |department=Books Help |website=Google Help |accessdate=2019-07-23}} |
|||
⚫ | |||
<!-- CATEGORIES AND INTERWIKIS HERE, THANKS --> |
|||
⚫ | |||
==Generator== |
|||
</includeonly> |
|||
* [https://citer.toolforge.org Citer], hosted on the Wikimedia Toolforge, can be used to convert Google Books URLs—as well as many other forms of universal identifiers ([[Digital object identifier|DOI]], [[International Standard Book Number|ISBN]], [[PubMed#PubMed%20identifier|PMID]],etc.)—into full {{tlx|cite book}} transclusions. |
|||
<includeonly>{{sandbox other|1=<!-- keep sandbox out of categories -->|2= |
|||
<includeonly> |
|||
⚫ | |||
[[vi:Bản mẫu:Google books]] |
|||
[[Category:Catalog lookup templates]] |
|||
</includeonly> |
|||
[[Category:Free content external link templates]] |
|||
⚫ |
Revision as of 13:51, 3 September 2024
This is a documentation subpage for Template:Google books. It may contain usage information, categories and other content that is not part of the original template page. |
This template is used on approximately 19,000 pages and changes may be widely noticed. Test changes in the template's /sandbox or /testcases subpages, or in your own user subpage. Consider discussing changes on the talk page before implementing them. |
Usage
{{Google books|id|title|page=|keywords=|text=|plainurl=}}
The page
, keywords
, text
, and plainurl
parameters are all optional.
The |id=
parameter is the string of twelve characters found in the specific Google Books URL after "id=" but before "&".
The |title=
parameter is used to specify the publication title when used as a link (and not as a bare URL; |title=
is not useful when |plainurl=
is used).
The |page=
parameter may be used to link to a particular 'normal' page (i.e. PA24). |pg=
can be used for 'special' pages
- Normal pages, e.g.
|pg=PA5
for normal page 5. This is equivalent to|page=5
- Roman pages, e.g.
|pg=PR5
for roman page v - preamble pages, e.g.
|pg=PP5
for preamble page 5 (often not officially numbered, scheme varies from book to book) - e-book pages, e.g.
|pg=PT5
, for the fifth page of an e-book (often not officially numbered)
If the page is prefaced with RA-, that can usually be removed.
The |keywords=
parameter may be used to search for particular keywords within the text (corresponding to the q parameter in the Google URL); |text=
searches for a quoted phrase (corresponding to the dq parameter in the Google URL). Only one of these should be used.
The |plainurl=
parameter tells the template to output a URL (web address) only, rather than a linked book title and page number. Use |plainurl=yes
when using this template in a |url=
parameter of a citation template. |plain-url=
works as an alias.
In many cases when converting an existing Google Books URL, only one of the above should be used. When multiple parameters are present, the final target page is much more likely to vary over time. If linking to a specific page, only use the page parameter, and if doing a text search then do not include the page parameter. The desired parameters are often the ones after the # symbol, since GB uses javascript.
For external links, the following all do the same thing:
{{Google books|id=id|title=title}}
{{Google books|1=id|2=title}}
{{Google books|id|title}}
For URLs, the following all do the same thing:
{{Google books|id=id|plainurl=yes}}
{{Google books|1=id|plainurl=yes}}
{{Google books|id|plainurl=yes}}
Example 1:
Brackenridge, H. M. {{Google books|7ydCAAAAIAAJ|History of the Western Insurrection}}
creates
- Brackenridge, H. M. History of the Western Insurrection at Google Books.
Example 2:
Brackenridge, H. M. {{Google books|7ydCAAAAIAAJ|History of the Western Insurrection|keywords=blood}}
creates
- Brackenridge, H. M. History of the Western Insurrection at Google Books.
Example 3:
Brackenridge, H. M. {{Google books|7ydCAAAAIAAJ|History of the Western Insurrection|page=42}}
creates
- Brackenridge, H. M. History of the Western Insurrection, p. 42, at Google Books.
Example 4:
{{cite book|last=Brackenridge|first=H.M.|title=History of the Western Insurrection|url={{Google books|7ydCAAAAIAAJ|page=42|plainurl=yes}}|page=42}}
creates
- Brackenridge, H.M. History of the Western Insurrection. p. 42.
Example 5:
Brackenridge, H. M. {{Google books|7ydCAAAAIAAJ|History of the Western Insurrection|page=42|text=Perhaps bloodshed might have been avoided.}}
creates
- Brackenridge, H. M. History of the Western Insurrection, p. 42, at Google Books.
Example 6:
Brackenridge, H. M. {{Google books|7ydCAAAAIAAJ|History of the Western Insurrection|pg=PP2}}
creates this which links to the bookplate on the inside cover
- Brackenridge, H. M. History of the Western Insurrection at Google Books.
Example 7:
Brackenridge, H. M. {{Google books|7ydCAAAAIAAJ|History of the Western Insurrection|pg=PR1}}
creates this which links to the title page complete with inscriptions
- Brackenridge, H. M. History of the Western Insurrection at Google Books.
See also
- Google Books ID (P675) (see uses)
Further research
- "Static Links". Google Books APIs. Google Developers. Retrieved 2019-07-23.
- "Linking to individual titles on Google Books". Books Help. Google Help. Retrieved 2019-07-23.
Generator
- Citer, hosted on the Wikimedia Toolforge, can be used to convert Google Books URLs—as well as many other forms of universal identifiers (DOI, ISBN, PMID,etc.)—into full
{{cite book}}
transclusions.