Difference between revisions of "Template:HathiTrust Catalog/doc"

From blackwiki
Jump to navigation Jump to search
imported>SMcCandlish
(bypass template redirect)
 
(18 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{documentation subpage}}__NOTOC__
+
{{Documentation subpage}}
Creates an external link to a [[public domain]] work's catalog held by the [[HathiTrust|HathiTrust Digital Library]].
+
{{Ombox|type=notice|small=yes|text=Alternative spelling [[Wikipedia:Redirect|redirect]]:
 +
* {{braces|{{no redirect|Template:HathiTrust Catalogue|HathiTrust Catalogue}}}}}}
 +
{{Lua|Module:EditAtWikidata|Module:WikidataCheck}}
 +
{{Tracks and uses Wikidata|P1844}}
 +
This templates generates an external link to a catalog record of a work in the [[public domain]] at the [[HathiTrust Digital Library]].
  
=== Usage ===
+
== Usage ==
Unnamed parameters:
+
; Unnamed parameters
: <code><nowiki>{{</nowiki>Hathitrust Catalog| id | title <nowiki>}}</nowiki></code>
+
: <code><nowiki>{{</nowiki>{{BASEPAGENAME}}|''ID''|''TITLE''<nowiki>}}</nowiki></code>
 +
; Named parameters
 +
: <code><nowiki>{{</nowiki>{{BASEPAGENAME}}|id=''ID''|title=''TITLE''<nowiki>}}</nowiki></code>{{-}}
  
Named parameters:
+
=== Example ===
: <code><nowiki>{{</nowiki>HathiTrust Catalog| id = ''###'' | title = ''title of work'' <nowiki>}}</nowiki></code>
+
{{Quotebox
 +
|align  = right
 +
|width  = 35%
 +
|border = 2px
 +
|tstyle = text-align:left;
 +
|title  = Catalog identifier string
 +
|quote  = Copy a work's identifier at the [https://www.hathitrust.org/ '''HathiTrust Digital Library''']:{{ubl|style=text-indent:0.5em;font-size:92%;<!--line-height:2.5em;-->|&nbsp;
 +
|1. <code><nowiki>catalog.hathitrust.org/Record/</nowiki>{{hir|004409120}}</code>
 +
|2. <code><nowiki>catalog.hathitrust.org/Record/</nowiki>{{hir|009014066|bc=lightgreen}}</code>|&nbsp;}}
 +
Identifiers can also be found on a work's [[Wikidata|'''Wikidata item''']].
 +
}}
  
=== Examples ===
+
1. If no custom title is set, the template defaults to {{tlx|PAGENAMEBASE}}
Unnamed parameters:
+
: {{vad|Markup:}} {{spaces|2}} <code><nowiki>{{HathiTrust Catalog|</nowiki>{{hir|004409120}}<nowiki>}}</nowiki></code>
: {{tlc|HathiTrust Catalog|004409120|The Jewish Encyclopedia}}
+
: {{vad|Result:}} {{spaces|2}} {{HathiTrust Catalog|004409120}}
: &rarr; {{HathiTrust Catalog|004409120|The Jewish Encyclopedia}}
 
  
Named parameters:
+
2. To set a custom title
: {{tlc|HathiTrust Catalog|id{{=}}004409120|title{{=}}The Jewish Encyclopedia}}
+
: {{vad|Markup:}} {{spaces|2}} <code><nowiki>{{HathiTrust Catalog|</nowiki>{{hir|009014066|bc=lightgreen}}<nowiki>|Life with the Esquimaux}}</nowiki></code>
: &rarr; {{HathiTrust Catalog|id=004409120|title=The Jewish Encyclopedia}}
+
: {{vad|Result:}} {{spaces|2}} {{HathiTrust Catalog|009014066|Life with the Esquimaux}}{{-}}
  
Without <code>title</code> parameter:
+
== TemplateData ==
: {{tlc|HathiTrust Catalog|004409120}}
+
{{Collapse top|title=[[Wikipedia:TemplateData|TemplateData]] documentation used by [[Wikipedia:VisualEditor|VisualEditor]] and other tools}}
: &rarr; {{HathiTrust Catalog|004409120}}
+
{{TemplateData header|noheader=1}}
 +
<templatedata>
 +
{
 +
"description": "This template generates an external link to a catalog record at the HathiTrust Digital Library.",
 +
"params": {
 +
"1": {
 +
"label": "ID",
 +
"aliases": [ "id" ],
 +
"description": "Identifier string used in the URL.",
 +
"example": "009014066",
 +
"type": "string",
 +
"required": true
 +
},
 +
"2": {
 +
"label": "Title",
 +
"aliases": [ "title" ],
 +
"description": "Title displayed in the link text. Defaults to the article's page name, without disambiguation.",
 +
"default": "{{PAGENAME}}",
 +
"type": "line",
 +
"required": false
 +
}
 +
}
 +
}
 +
</templatedata>
 +
{{Collapse bottom}}
  
Without <code>id</code> parameter:
+
=== Tracking categories ===
: {{tlc|HathiTrust Catalog||The Jewish Encyclopedia}}
+
* {{clc|Articles with HathiTrust links}}
: &rarr; {{HathiTrust Catalog||The Jewish Encyclopedia}}
+
* {{clc|HathiTrust Catalog not in Wikidata}}
 +
* {{clc|HathiTrust Catalog same as Wikidata}}
 +
* {{clc|HathiTrust Catalog different from Wikidata}}
  
=== Parameters ===
+
== See also ==
* '''id''' – identifier in the target URL, e.g. <code><nowiki>catalog.hathitrust.org/Record/</nowiki>{{hir|bc=lightgreen|#########}}</code>
+
* {{tltt|HathiTrust}}
* '''title''' – an override field, it will default to the page name
 
  
=== See also ===
+
<includeonly>{{Sandbox other||
{{Wikidata property|P1844}}
 
* {{tl|HathiTrust}}
 
 
 
<includeonly>{{#ifeq:{{SUBPAGENAME}}|sandbox | |
 
 
<!-- Categories below this line, please; interwikis at Wikidata -->
 
<!-- Categories below this line, please; interwikis at Wikidata -->
[[Category:GLAM external link templates]]
+
[[Category:Catalog lookup templates|HathiTrust Catalog]]
 +
[[Category:Free content external link templates|HathiTrust Catalog]]
 
}}</includeonly>
 
}}</includeonly>

Latest revision as of 23:55, 28 July 2020

Template:Tracks and uses Wikidata This templates generates an external link to a catalog record of a work in the public domain at the HathiTrust Digital Library.

Usage

Unnamed parameters
{{HathiTrust Catalog|ID|TITLE}}
Named parameters
{{HathiTrust Catalog|id=ID|title=TITLE}}

Example

Template:Quotebox

1. If no custom title is set, the template defaults to {{PAGENAMEBASE}}

<span style="display:inline-block; width:Script error: No such module "If empty".; text-align:Script error: No such module "If empty".; font-weight:Script error: No such module "If empty".;">Markup:    {{HathiTrust Catalog|004409120}}
<span style="display:inline-block; width:Script error: No such module "If empty".; text-align:Script error: No such module "If empty".; font-weight:Script error: No such module "If empty".;">Result:    Template:PAGENAMEBASE at the HathiTrust Digital LibraryScript error: No such module "EditAtWikidata".Template:WikidataCheck

2. To set a custom title

<span style="display:inline-block; width:Script error: No such module "If empty".; text-align:Script error: No such module "If empty".; font-weight:Script error: No such module "If empty".;">Markup:    {{HathiTrust Catalog|009014066|Life with the Esquimaux}}
<span style="display:inline-block; width:Script error: No such module "If empty".; text-align:Script error: No such module "If empty".; font-weight:Script error: No such module "If empty".;">Result:    Life with the Esquimaux at the HathiTrust Digital LibraryScript error: No such module "EditAtWikidata".Template:WikidataCheck

TemplateData

TemplateData documentation used by VisualEditor and other tools
See the monthly parameter usage report for this template.

TemplateData for HathiTrust Catalog

This template generates an external link to a catalog record at the HathiTrust Digital Library.

Template parameters

ParameterDescriptionTypeStatus
ID1 id

Identifier string used in the URL.

Example
009014066
Stringrequired
Title2 title

Title displayed in the link text. Defaults to the article's page name, without disambiguation.

Default
{{PAGENAME}}
Lineoptional

Tracking categories

See also