Difference between revisions of "Template:CycleBase/doc"
imported>Zyxw (note available Wikidata property, show alternative URL) |
imported>Zyxw (updates for use of Wikidata) |
||
| Line 1: | Line 1: | ||
{{Documentation subpage}} | {{Documentation subpage}} | ||
<!-- Place categories where indicated at the bottom of this page and interwikis at Wikidata --> | <!-- Place categories where indicated at the bottom of this page and interwikis at Wikidata --> | ||
| − | {{Wikidata | + | {{Uses Wikidata|P4508}} |
| + | {{Lua|Module:EditAtWikidata}} | ||
'''{{NAMESPACE}}:{{BASEPAGENAME}}''' displays an external link to a [[cycling (sport)|cyclist's]] page at the [http://cyclebase.nl/ CycleBase.nl] website. It is intended for use in the [[Wikipedia:External links|external links]] section of an article. | '''{{NAMESPACE}}:{{BASEPAGENAME}}''' displays an external link to a [[cycling (sport)|cyclist's]] page at the [http://cyclebase.nl/ CycleBase.nl] website. It is intended for use in the [[Wikipedia:External links|external links]] section of an article. | ||
== Usage == | == Usage == | ||
| − | Unnamed parameters | + | ; Unnamed parameters |
| − | : <code><nowiki> | + | : <code><nowiki>{{</nowiki>{{BASEPAGENAME}} | ''ID'' }}</code> |
| − | : <code><nowiki> | + | : <code><nowiki>{{</nowiki>{{BASEPAGENAME}} | ''ID'' | ''NAME'' }}</code> |
| − | Named parameters | + | ; Named parameters |
| − | : <code><nowiki> | + | : <code><nowiki>{{</nowiki>{{BASEPAGENAME}} | id= ''ID'' }}</code> |
| − | : <code><nowiki> | + | : <code><nowiki>{{</nowiki>{{BASEPAGENAME}} | id= ''ID'' | name= ''NAME'' }}</code> |
| + | |||
| + | ; Using [[Wikidata]] property {{Property|P4508}} | ||
| + | : <code><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>}}</nowiki></code> | ||
| + | : <code><nowiki>{{</nowiki>{{BASEPAGENAME}} | name= ''NAME'' }}</code> | ||
== Examples == | == Examples == | ||
=== Unnamed parameters === | === Unnamed parameters === | ||
| − | + | ; URLs | |
: <kbd>[http://www.cyclebase.nl/?lang=en&page=renner&id=35840 http://www.cyclebase.nl/?lang=en&page=renner&id={{hilite|35840}}]</kbd> | : <kbd>[http://www.cyclebase.nl/?lang=en&page=renner&id=35840 http://www.cyclebase.nl/?lang=en&page=renner&id={{hilite|35840}}]</kbd> | ||
: <kbd>[http://www.cyclebase.nl/?lang=en&news=en&pc=normal&page=renner&id=35840 http://www.cyclebase.nl/?lang=en&news=en&pc=normal&page=renner&id={{hilite|35840}}]</kbd> | : <kbd>[http://www.cyclebase.nl/?lang=en&news=en&pc=normal&page=renner&id=35840 http://www.cyclebase.nl/?lang=en&news=en&pc=normal&page=renner&id={{hilite|35840}}]</kbd> | ||
| + | : <kbd>[http://www.cyclebase.nl/index.php?uid=0&sid=0&lang=nl&news=nl&pc=normal&page=renner&db=m&id=35840 http://www.cyclebase.nl/index.php?uid=0&sid=0&lang=nl&news=nl&pc=normal&page=renner&db=m&id={{hilite|35840}}]</kbd> | ||
| − | + | ; Usage | |
: <code><nowiki>* {{</nowiki>{{BASEPAGENAME}} | 35840 | Anna van der Breggen }}</code> | : <code><nowiki>* {{</nowiki>{{BASEPAGENAME}} | 35840 | Anna van der Breggen }}</code> | ||
| − | + | ; Output | |
:* {{{{BASEPAGENAME}} | 35840 | Anna van der Breggen }} | :* {{{{BASEPAGENAME}} | 35840 | Anna van der Breggen }} | ||
=== Named parameters === | === Named parameters === | ||
| − | + | ; URLs | |
: <kbd>[http://www.cyclebase.nl/?lang=en&page=renner&id=16289 http://www.cyclebase.nl/?lang=en&page=renner&id={{hilite|16289}}]</kbd> | : <kbd>[http://www.cyclebase.nl/?lang=en&page=renner&id=16289 http://www.cyclebase.nl/?lang=en&page=renner&id={{hilite|16289}}]</kbd> | ||
: <kbd>[http://www.cyclebase.nl/?lang=en&news=en&pc=normal&page=renner&id=16289 http://www.cyclebase.nl/?lang=en&news=en&pc=normal&page=renner&id={{hilite|16289}}]</kbd> | : <kbd>[http://www.cyclebase.nl/?lang=en&news=en&pc=normal&page=renner&id=16289 http://www.cyclebase.nl/?lang=en&news=en&pc=normal&page=renner&id={{hilite|16289}}]</kbd> | ||
| + | : <kbd>[http://www.cyclebase.nl/index.php?uid=0&sid=0&lang=nl&news=nl&pc=normal&page=renner&db=m&id=16289 http://www.cyclebase.nl/index.php?uid=0&sid=0&lang=nl&news=nl&pc=normal&page=renner&db=m&id={{hilite|16289}}]</kbd> | ||
| − | + | ; Usage | |
: <code><nowiki>* {{</nowiki>{{BASEPAGENAME}} |id= 16289 |name= Alejandro Valverde Belmonte }}</code> | : <code><nowiki>* {{</nowiki>{{BASEPAGENAME}} |id= 16289 |name= Alejandro Valverde Belmonte }}</code> | ||
| − | + | ; Output | |
:* {{{{BASEPAGENAME}} |id= 16289 |name= Alejandro Valverde Belmonte }} | :* {{{{BASEPAGENAME}} |id= 16289 |name= Alejandro Valverde Belmonte }} | ||
| + | |||
| + | === No parameters and Wikidata property not defined === | ||
| + | ; Usage | ||
| + | : <code><nowiki>* {{</nowiki>{{BASEPAGENAME}}<nowiki>}}</nowiki></code> | ||
| + | |||
| + | ; Output | ||
| + | :* {{ {{BASEPAGENAME}} }} | ||
== TemplateData == | == TemplateData == | ||
| Line 47: | Line 61: | ||
"label": "id", | "label": "id", | ||
"aliases": ["1"], | "aliases": ["1"], | ||
| − | "description": "The \"id\" parameter (or unnamed parameter \"1\") should contain the ID portion of the URL. Example: 35840 is the ID portion of http://www.cyclebase.nl/?lang=en&page=renner&id=35840 or http://www.cyclebase.nl/?lang=en&news=en&pc=normal&page=renner&id=35840.", | + | "description": "The \"id\" parameter (or unnamed parameter \"1\") should contain the ID portion of the URL. Example: 35840 is the ID portion of http://www.cyclebase.nl/?lang=en&page=renner&id=35840 or http://www.cyclebase.nl/?lang=en&news=en&pc=normal&page=renner&id=35840. This parameter is optional if Wikidata property 4508 exists, but required if not.", |
"type": "number", | "type": "number", | ||
| − | "required": | + | "required": false, |
| + | "default": "Wikidata property P4508" | ||
}, | }, | ||
"name": { | "name": { | ||
| Line 76: | Line 91: | ||
[[Category:Cycling external link templates]] | [[Category:Cycling external link templates]] | ||
[[Category:People and person external link templates]] | [[Category:People and person external link templates]] | ||
| + | [[Category:External link templates using Wikidata]] | ||
}}</includeonly> | }}</includeonly> | ||
Revision as of 19:25, 21 November 2018
| This is a documentation subpage for Template:CycleBase. It contains usage information, categories and other content that is not part of the original template page. |
| This template uses Lua: |
Template:CycleBase displays an external link to a cyclist's page at the CycleBase.nl website. It is intended for use in the external links section of an article.
Contents
Usage
- Unnamed parameters
{{CycleBase | ID }}{{CycleBase | ID | NAME }}
- Named parameters
{{CycleBase | id= ID }}{{CycleBase | id= ID | name= NAME }}
- Using Wikidata property Template:Property
{{CycleBase}}{{CycleBase | name= NAME }}
Examples
Unnamed parameters
- URLs
- http://www.cyclebase.nl/?lang=en&page=renner&id=35840
- http://www.cyclebase.nl/?lang=en&news=en&pc=normal&page=renner&id=35840
- http://www.cyclebase.nl/index.php?uid=0&sid=0&lang=nl&news=nl&pc=normal&page=renner&db=m&id=35840
- Usage
* {{CycleBase | 35840 | Anna van der Breggen }}
- Output
-
- Anna van der Breggen at CycleBase.nlScript error: No such module "EditAtWikidata".
Named parameters
- URLs
- http://www.cyclebase.nl/?lang=en&page=renner&id=16289
- http://www.cyclebase.nl/?lang=en&news=en&pc=normal&page=renner&id=16289
- http://www.cyclebase.nl/index.php?uid=0&sid=0&lang=nl&news=nl&pc=normal&page=renner&db=m&id=16289
- Usage
* {{CycleBase |id= 16289 |name= Alejandro Valverde Belmonte }}
- Output
-
- Alejandro Valverde Belmonte at CycleBase.nlScript error: No such module "EditAtWikidata".
No parameters and Wikidata property not defined
- Usage
* {{CycleBase}}
- Output
-
- Template:PAGENAMEBASE at CycleBase.nlScript error: No such module "EditAtWikidata".
TemplateData
TemplateData for CycleBase
This template displays an external link to a cyclist's page at the CycleBase.nl website. It is intended for use in the external links section of an article.
| Parameter | Description | Type | Status | |
|---|---|---|---|---|
| id | id 1 | The "id" parameter (or unnamed parameter "1") should contain the ID portion of the URL. Example: 35840 is the ID portion of http://www.cyclebase.nl/?lang=en&page=renner&id=35840 or http://www.cyclebase.nl/?lang=en&news=en&pc=normal&page=renner&id=35840. This parameter is optional if Wikidata property 4508 exists, but required if not.
| Number | optional |
| name | name 2 | The "name" parameter (or unnamed parameter "2") may be used to specify the link text, which should be the name of the cyclist. This parameter is optional; it defaults to the Wikipedia article name, without any disambiguation such as "(cyclist)".
| String | optional |
See also