Difference between revisions of "Template:Cricketarchive/doc"
imported>Zyxw m (Since <tt> is obsolete in HTML5, replace it with <kbd> – see HTML element#tt, Wikipedia:HTML5, and mw:Help:Extension:Linter/obsolete-tag. using AWB) |
imported>Vanisaac m (→See also: clean up per WP:CAT#T and WP:AWBREQ add template:Sandbox other) |
||
| (3 intermediate revisions by 2 users not shown) | |||
| Line 1: | Line 1: | ||
{{Documentation subpage}} | {{Documentation subpage}} | ||
<!-- Categories go at the bottom of this page and interwikis go in Wikidata. --> | <!-- Categories go at the bottom of this page and interwikis go in Wikidata. --> | ||
| − | + | {{Template redirect|CricketArchive}} | |
{{Uses Wikidata|P2698}} | {{Uses Wikidata|P2698}} | ||
{{Lua|Module:EditAtWikidata}} | {{Lua|Module:EditAtWikidata}} | ||
| Line 10: | Line 10: | ||
== Usage == | == Usage == | ||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
Using "id" parameter: | Using "id" parameter: | ||
: <code><nowiki>{{</nowiki>{{BASEPAGENAME}} | id= ''ID'' <nowiki>}}</nowiki></code> | : <code><nowiki>{{</nowiki>{{BASEPAGENAME}} | id= ''ID'' <nowiki>}}</nowiki></code> | ||
: <code><nowiki>{{</nowiki>{{BASEPAGENAME}} | id= ''ID'' | name= ''NAME'' <nowiki>}}</nowiki></code> | : <code><nowiki>{{</nowiki>{{BASEPAGENAME}} | id= ''ID'' | name= ''NAME'' <nowiki>}}</nowiki></code> | ||
| + | : <code><nowiki>{{</nowiki>{{BASEPAGENAME}} | id= ''ID'' | name= ''NAME'' | archive= ''NUMBER'' <nowiki>}}</nowiki></code> | ||
: <code><nowiki>{{</nowiki>{{BASEPAGENAME}} | id= ''ID'' | name= ''NAME'' | accessdate= ''DATE'' <nowiki>}}</nowiki></code> | : <code><nowiki>{{</nowiki>{{BASEPAGENAME}} | id= ''ID'' | name= ''NAME'' | accessdate= ''DATE'' <nowiki>}}</nowiki></code> | ||
| Line 23: | Line 19: | ||
: <code><nowiki>{{</nowiki>{{BASEPAGENAME}} | ref= ''REF'' <nowiki>}}</nowiki></code> | : <code><nowiki>{{</nowiki>{{BASEPAGENAME}} | ref= ''REF'' <nowiki>}}</nowiki></code> | ||
: <code><nowiki>{{</nowiki>{{BASEPAGENAME}} | ref= ''REF'' | name= ''NAME'' <nowiki>}}</nowiki></code> | : <code><nowiki>{{</nowiki>{{BASEPAGENAME}} | ref= ''REF'' | name= ''NAME'' <nowiki>}}</nowiki></code> | ||
| + | : <code><nowiki>{{</nowiki>{{BASEPAGENAME}} | ref= ''REF'' | name= ''NAME'' | archive= ''NUMBER'' <nowiki>}}</nowiki></code> | ||
: <code><nowiki>{{</nowiki>{{BASEPAGENAME}} | ref= ''REF'' | name= ''NAME'' | accessdate= ''DATE'' <nowiki>}}</nowiki></code> | : <code><nowiki>{{</nowiki>{{BASEPAGENAME}} | ref= ''REF'' | name= ''NAME'' | accessdate= ''DATE'' <nowiki>}}</nowiki></code> | ||
| + | |||
| + | Using [[Wikidata]] property {{Property|P2698}}: | ||
| + | : <code><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>}}</nowiki></code> | ||
| + | : <code><nowiki>{{</nowiki>{{BASEPAGENAME}} | name= ''NAME'' <nowiki>}}</nowiki></code> | ||
| + | : <code><nowiki>{{</nowiki>{{BASEPAGENAME}} | name= ''NAME'' | archive= ''NUMBER'' <nowiki>}}</nowiki></code> | ||
| + | : <code><nowiki>{{</nowiki>{{BASEPAGENAME}} | name= ''NAME'' | accessdate= ''DATE'' <nowiki>}}</nowiki></code> | ||
== Examples == | == Examples == | ||
| − | + | {{For|additional examples showing how the URL is formatted based on the number of digits in the "id"|{{NAMESPACE}}:{{BASEPAGENAME}}/testcases}} | |
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | : | ||
=== Using "id" parameter === | === Using "id" parameter === | ||
| − | + | <kbd>[https://cricketarchive.com/Archive/Players/1/1933/1933.html https://cricketarchive.com/Archive/Players/1/1933/{{hilite|1933}}.html]</kbd> | |
| − | |||
| − | |||
| − | |||
''Usage:'' | ''Usage:'' | ||
: <code><nowiki>{{</nowiki>{{BASEPAGENAME}} | id= 1933 | name= Sachin Tendulkar }}</code> | : <code><nowiki>{{</nowiki>{{BASEPAGENAME}} | id= 1933 | name= Sachin Tendulkar }}</code> | ||
: {{{{BASEPAGENAME}} | id= 1933 | name= Sachin Tendulkar }} | : {{{{BASEPAGENAME}} | id= 1933 | name= Sachin Tendulkar }} | ||
| + | |||
| + | ''Usage with archive parameter:'' | ||
| + | : <code><nowiki>{{</nowiki>{{BASEPAGENAME}} | id= 1933 | name= Sachin Tendulkar | archive= 20170221000549 }}</code> | ||
| + | : {{{{BASEPAGENAME}} | id= 1933 | name= Sachin Tendulkar | archive= 20170221000549 }} | ||
''Usage with accessdate parameter:'' | ''Usage with accessdate parameter:'' | ||
| Line 53: | Line 47: | ||
=== Using "ref" parameter === | === Using "ref" parameter === | ||
| − | + | <kbd>[https://cricketarchive.com/Archive/Grounds/22/1547.html https://cricketarchive.com/{{hilite|Archive/Grounds/22/1547}}.html]</kbd> | |
| − | |||
''Usage:'' | ''Usage:'' | ||
| Line 63: | Line 56: | ||
: <code><nowiki>{{</nowiki>{{BASEPAGENAME}} | ref= Archive/Grounds/22/1547.html | name= Zafar Ali Stadium }}</code> | : <code><nowiki>{{</nowiki>{{BASEPAGENAME}} | ref= Archive/Grounds/22/1547.html | name= Zafar Ali Stadium }}</code> | ||
: {{{{BASEPAGENAME}} | ref= Archive/Grounds/22/1547.html | name= Zafar Ali Stadium }} | : {{{{BASEPAGENAME}} | ref= Archive/Grounds/22/1547.html | name= Zafar Ali Stadium }} | ||
| + | |||
| + | ''Usage with archive parameter:'' | ||
| + | : <code><nowiki>{{</nowiki>{{BASEPAGENAME}} |ref=Archive/Grounds/22/1547 |name=Zafar Ali Stadium |archive=20170113134139}}</code> | ||
| + | : {{{{BASEPAGENAME}} |ref=Archive/Grounds/22/1547 |name=Zafar Ali Stadium |archive=20170113134139}} | ||
''Usage with accessdate parameter:'' | ''Usage with accessdate parameter:'' | ||
| − | : <code><nowiki>{{</nowiki>{{BASEPAGENAME}} | ref= Archive/Grounds/22/1547 | name= Zafar Ali Stadium | accessdate= 25 February 2017 }}</code> | + | : <code><nowiki>{{</nowiki>{{BASEPAGENAME}} |ref=Archive/Grounds/22/1547 |name=Zafar Ali Stadium |accessdate=25 February 2017}}</code> |
| − | : {{{{BASEPAGENAME}} | ref= Archive/Grounds/22/1547 | name= Zafar Ali Stadium | accessdate= 25 February 2017 }} | + | : {{{{BASEPAGENAME}} |ref=Archive/Grounds/22/1547 |name=Zafar Ali Stadium |accessdate=25 February 2017}} |
| + | |||
| + | === Using ID from Wikidata === | ||
| + | The Wikidata examples are simulated; they only work as shown if used in the article for [[Sachin Tendulkar]]. | ||
| + | |||
| + | ''Usage:'' | ||
| + | : <code><nowiki>{{</nowiki>{{BASEPAGENAME}}}}</code> | ||
| + | : [https://cricketarchive.com/Archive/Players/1/1933/1933.html Sachin Tendulkar] at CricketArchive [[File:OOjs UI icon edit-ltr-progressive.svg |frameless |text-top |10px |alt=Edit this at Wikidata |link=https://www.wikidata.org/wiki/Q9488#P2698 |Edit this at Wikidata]] {{subscription required}} | ||
| + | |||
| + | ''Usage with accessdate parameter:'' | ||
| + | : <code><nowiki>{{</nowiki>{{BASEPAGENAME}} | accessdate= 25 February 2017 }}</code> | ||
| + | : {{{{BASEPAGENAME}} | id= 1933 | name= Sachin Tendulkar | accessdate= 25 February 2017 }} | ||
| + | |||
| + | === Missing "id" or "ref" parameters and no ID in Wikidata === | ||
| + | ''Usage:'' | ||
| + | : <code><nowiki>{{</nowiki>{{BASEPAGENAME}}}}</code> | ||
| + | : {{{{BASEPAGENAME}} }} | ||
== TemplateData == | == TemplateData == | ||
{{TemplateData header}} | {{TemplateData header}} | ||
| − | <templatedata>{ | + | <templatedata> |
| − | "description": "This template displays an external link to a CricketArchive web page. Links to cricket player profiles are created with the \"id\" parameter and links to other pages are created with the \"ref\" parameter. It is intended for use in the external links section of an article.", | + | { |
| − | "params": { | + | "description": "This template displays an external link to a CricketArchive web page. Links to cricket player profiles are created with the \"id\" parameter and links to other pages are created with the \"ref\" parameter. It is intended for use in the external links section of an article.", |
| − | + | "params": { | |
| − | + | "id": { | |
| − | + | "label": "id", | |
| − | + | "description": "The \"id\" parameter should contain the ID number in the URL for the player's profile. Example: 1933 is the \"id\" in https://cricketarchive.com/Archive/Players/1/1933/1933.html. It is required when not using the \"ref\" parameter or the Wikidata property.", | |
| − | + | "default": "Wikidata property P2698", | |
| − | + | "example": "|id=1933", | |
| − | + | "type": "number", | |
| − | + | "required": false | |
| − | + | }, | |
| − | + | "ref": { | |
| − | + | "label": "ref", | |
| − | + | "description": "The \"ref\" parameter is optional and only used when the player \"id\" is not specified. If used, it should contain the portion of the URL between \"https://cricketarchive.com/\" and \".html\". Example: Archive/Grounds/22/1547 is the \"ref\" portion of https://cricketarchive.com/Archive/Grounds/22/1547.html. It is required when not using the \"id\" parameter or the Wikidata property.", | |
| − | + | "example": "|ref=Archive/Grounds/22/1547", | |
| − | + | "type": "string", | |
| − | + | "required": false | |
| − | + | }, | |
| − | + | "name": { | |
| − | + | "label": "name", | |
| − | + | "description": "The \"name\" parameter may be used to specify the link text. This parameter is optional; it defaults to the Wikipedia article name, without any disambiguation such as \"(cricketer)\".", | |
| − | + | "default": "{{PAGENAMEBASE}}", | |
| − | + | "example": "|name=Sachin Tendulkar", | |
| − | + | "type": "string", | |
| − | + | "required": false | |
| − | + | }, | |
| − | + | "archive": { | |
| − | + | "label": "archive", | |
| − | }}</templatedata> | + | "description": "The optional \"archive\" parameter may be used to display a link to archive of the page. The value of this parameter should be a number representing the date/time in an Internet Archive URL, such as 20170221000549 in https://web.archive.org/web/20170221000549/https://cricketarchive.com/Archive/Players/1/1933/1933.html.", |
| + | "example": "|archive=20170221000549", | ||
| + | "type": "number", | ||
| + | "required": false | ||
| + | }, | ||
| + | "accessdate": { | ||
| + | "label": "accessdate", | ||
| + | "description": "The optional \"accessdate\" parameter may be used to document the date when the link was accessed or retrieved. It also changes the output to a citation format, such as \"Name\". CricketArchive. Retrieved 25 February 2017.", | ||
| + | "example": "|accessdate=25 February 2017", | ||
| + | "type": "date", | ||
| + | "required": false | ||
| + | } | ||
| + | }, | ||
| + | "paramOrder": [ | ||
| + | "id", | ||
| + | "ref", | ||
| + | "name", | ||
| + | "archive", | ||
| + | "accessdate" | ||
| + | ] | ||
| + | } | ||
| + | </templatedata> | ||
== Tracking category == | == Tracking category == | ||
| Line 110: | Line 144: | ||
* {{tlx|Yahoo! Cricket}}, which uses a similar format | * {{tlx|Yahoo! Cricket}}, which uses a similar format | ||
| − | <includeonly>{{ | + | <includeonly>{{Sandbox other|| |
<!-- Categories go here, and interwikis go in Wikidata --> | <!-- Categories go here, and interwikis go in Wikidata --> | ||
[[Category:Cricket external link templates]] | [[Category:Cricket external link templates]] | ||
[[Category:People and person external link templates]] | [[Category:People and person external link templates]] | ||
| + | [[Category:External link templates using Wikidata]] | ||
| + | [[Category:External link templates with archive parameter]] | ||
[[Category:External link templates with accessdate parameter]] | [[Category:External link templates with accessdate parameter]] | ||
| − | |||
[[Category:Templates that add a tracking category]] | [[Category:Templates that add a tracking category]] | ||
}}</includeonly> | }}</includeonly> | ||
Latest revision as of 22:14, 24 April 2020
| This is a documentation subpage for Template:Cricketarchive. It contains usage information, categories and other content that is not part of the original template page. |
Template:Template redirect Template:Uses Wikidata
| This template uses Lua: |
Template:Cricketarchive displays an external link to a CricketArchive web page. Links to cricket player profiles are created with the "id" parameter and links to other pages are created with the "ref" parameter. It is intended for use in the external links section of an article.
For players, the "id" value should be added to the Template:Wpl property in Wikidata. Then, if the "id" or "ref" parameters are not specified, the template will retrieve the id from Wikidata.
Contents
Usage
Using "id" parameter:
{{Cricketarchive | id= ID }}{{Cricketarchive | id= ID | name= NAME }}{{Cricketarchive | id= ID | name= NAME | archive= NUMBER }}{{Cricketarchive | id= ID | name= NAME | accessdate= DATE }}
Using "ref" parameter:
{{Cricketarchive | ref= REF }}{{Cricketarchive | ref= REF | name= NAME }}{{Cricketarchive | ref= REF | name= NAME | archive= NUMBER }}{{Cricketarchive | ref= REF | name= NAME | accessdate= DATE }}
Using Wikidata property Template:Property:
{{Cricketarchive}}{{Cricketarchive | name= NAME }}{{Cricketarchive | name= NAME | archive= NUMBER }}{{Cricketarchive | name= NAME | accessdate= DATE }}
Examples
Using "id" parameter
https://cricketarchive.com/Archive/Players/1/1933/1933.html
Usage:
{{Cricketarchive | id= 1933 | name= Sachin Tendulkar }}- Sachin Tendulkar at CricketArchiveScript error: No such module "EditAtWikidata". Template:Subscription required
Usage with archive parameter:
{{Cricketarchive | id= 1933 | name= Sachin Tendulkar | archive= 20170221000549 }}- Sachin Tendulkar at CricketArchiveScript error: No such module "EditAtWikidata". Template:Subscription required (archive)
Usage with accessdate parameter:
{{Cricketarchive | id= 1933 | name= Sachin Tendulkar | accessdate= 25 February 2017 }}- "Sachin Tendulkar". CricketArchive. Retrieved 25 February 2017. Template:Subscription required
Using "ref" parameter
https://cricketarchive.com/Archive/Grounds/22/1547.html
Usage:
{{Cricketarchive | ref= Archive/Grounds/22/1547 | name= Zafar Ali Stadium }}- Zafar Ali Stadium at CricketArchiveScript error: No such module "EditAtWikidata". Template:Subscription required
Usage with ".html" in ref parameter:
{{Cricketarchive | ref= Archive/Grounds/22/1547.html | name= Zafar Ali Stadium }}- Zafar Ali Stadium at CricketArchiveScript error: No such module "EditAtWikidata". Template:Subscription required
Usage with archive parameter:
{{Cricketarchive |ref=Archive/Grounds/22/1547 |name=Zafar Ali Stadium |archive=20170113134139}}- Zafar Ali Stadium at CricketArchiveScript error: No such module "EditAtWikidata". Template:Subscription required (archive)
Usage with accessdate parameter:
{{Cricketarchive |ref=Archive/Grounds/22/1547 |name=Zafar Ali Stadium |accessdate=25 February 2017}}- "Zafar Ali Stadium". CricketArchive. Retrieved 25 February 2017. Template:Subscription required
Using ID from Wikidata
The Wikidata examples are simulated; they only work as shown if used in the article for Sachin Tendulkar.
Usage:
{{Cricketarchive}}- Sachin Tendulkar at CricketArchive
Template:Subscription required
Usage with accessdate parameter:
{{Cricketarchive | accessdate= 25 February 2017 }}- "Sachin Tendulkar". CricketArchive. Retrieved 25 February 2017. Template:Subscription required
Missing "id" or "ref" parameters and no ID in Wikidata
Usage:
{{Cricketarchive}}- Expression error: Unrecognized punctuation character "{"./{{#property:P2698}}/{{#property:P2698}}.html Template:PAGENAMEBASE at CricketArchiveScript error: No such module "EditAtWikidata". Template:Subscription required
TemplateData
TemplateData for Cricketarchive
This template displays an external link to a CricketArchive web page. Links to cricket player profiles are created with the "id" parameter and links to other pages are created with the "ref" parameter. It is intended for use in the external links section of an article.
| Parameter | Description | Type | Status | |
|---|---|---|---|---|
| id | id | The "id" parameter should contain the ID number in the URL for the player's profile. Example: 1933 is the "id" in https://cricketarchive.com/Archive/Players/1/1933/1933.html. It is required when not using the "ref" parameter or the Wikidata property.
| Number | optional |
| ref | ref | The "ref" parameter is optional and only used when the player "id" is not specified. If used, it should contain the portion of the URL between "https://cricketarchive.com/" and ".html". Example: Archive/Grounds/22/1547 is the "ref" portion of https://cricketarchive.com/Archive/Grounds/22/1547.html. It is required when not using the "id" parameter or the Wikidata property.
| String | optional |
| name | name | The "name" parameter may be used to specify the link text. This parameter is optional; it defaults to the Wikipedia article name, without any disambiguation such as "(cricketer)".
| String | optional |
| archive | archive | The optional "archive" parameter may be used to display a link to archive of the page. The value of this parameter should be a number representing the date/time in an Internet Archive URL, such as 20170221000549 in https://web.archive.org/web/20170221000549/https://cricketarchive.com/Archive/Players/1/1933/1933.html.
| Number | optional |
| accessdate | accessdate | The optional "accessdate" parameter may be used to document the date when the link was accessed or retrieved. It also changes the output to a citation format, such as "Name". CricketArchive. Retrieved 25 February 2017.
| Date | optional |
Tracking category
- Category:Cricketarchive maintenance (0) – handles multiple maintenance issues using category sort keys:
1: pages using template with unnamed parameter 12: pages using template with unnamed parameter 2
See also
{{Cricinfo}}, which uses a similar format{{Yahoo! Cricket}}, which uses a similar format