Difference between revisions of "Template:BFI/doc"
imported>EdwardUK (updated to match BFI website) |
imported>Zyxw (update usage and examples, add TemplateData, update for use of Wikidata property) |
||
| Line 1: | Line 1: | ||
| − | + | <!-- Categories go at the bottom of this page and interwikis go in Wikidata. --> | |
| − | <!-- Categories | + | {{Uses Wikidata|P4438}} |
| + | {{Lua|Module:EditAtWikidata}} | ||
| + | |||
| + | '''{{NAMESPACE}}:{{BASEPAGENAME}}''' displays an external link to a page in the "Films, TV and people" section of the [[British Film Institute]] (BFI) website. It is intended for use in the [[Wikipedia:External links|external links]] section of an article. | ||
== Usage == | == Usage == | ||
| − | + | Unnamed parameters: | |
| + | : {{tlcw|{{BASEPAGENAME}} | <var>ID</var> }} | ||
| + | : {{tlcw|{{BASEPAGENAME}} | <var>ID</var> | <var>TITLE</var> }} | ||
| + | |||
| + | Named parameters: | ||
| + | : {{tlcw|{{BASEPAGENAME}} | id{{=}} <var>ID</var> }} | ||
| + | : {{tlcw|{{BASEPAGENAME}} | id{{=}} <var>ID</var> | title{{=}} <var>TITLE</var> }} | ||
| + | : {{tlcw|{{BASEPAGENAME}} | id{{=}} <var>ID</var> | name{{=}} <var>NAME</var> }} | ||
| + | |||
| + | Using [[Wikidata]] property [[d:Property:P4438|P4438]]: | ||
| + | : {{tlcw|{{BASEPAGENAME}} }} | ||
| + | : {{tlcw|{{BASEPAGENAME}} | title{{=}} <var>TITLE</var> }} | ||
| + | : {{tlcw|{{BASEPAGENAME}} | name{{=}} <var>NAME</var> }} | ||
| + | |||
| + | == Examples == | ||
| + | |||
| + | === Film === | ||
| + | ''URL:'' | ||
| + | : <kbd><nowiki>https://www.bfi.org.uk/films-tv-people/</nowiki>{{Hilite|4ce2b6b82c47d}}</kbd> | ||
| + | ''Usage:'' | ||
| + | : {{tlcw|a=1|{{BASEPAGENAME}} | id{{=}} 4ce2b6b82c47d | title{{=}} The 39 Steps }} | ||
| + | ''Output:'' | ||
| + | :* {{{{BASEPAGENAME}} | id= 4ce2b6b82c47d | title= The 39 Steps }} | ||
| − | < | + | === Person === |
| + | ''URL:'' | ||
| + | : <kbd><nowiki>https://www.bfi.org.uk/films-tv-people/</nowiki>{{Hilite|4ce2b9ee3449d}}</kbd> | ||
| + | ''Usage:'' | ||
| + | : {{tlcw|a=1|{{BASEPAGENAME}} | id{{=}} 4ce2b9ee3449d | name{{=}} Alfred Hitchcock }} | ||
| + | ''Output:'' | ||
| + | :* {{{{BASEPAGENAME}} | id= 4ce2b9ee3449d | name= Alfred Hitchcock }} | ||
| − | + | === No ID in template or Wikidata === | |
| − | {| | + | ; Usage |
| − | | | + | : {{tlcw|a=1|{{BASEPAGENAME}} }} |
| − | + | ; Output | |
| − | + | :* {{{{BASEPAGENAME}} }} | |
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | == | + | == TemplateData == |
| − | + | {{TemplateData header}} | |
| − | + | <templatedata> | |
| − | + | { | |
| + | "description": "This template displays an external link to a page in the \"Films, TV and people\" section of the British Film Institute (BFI) website. It is intended for use in the external links section of an article.", | ||
| + | "params": { | ||
| + | "id": { | ||
| + | "label": "id", | ||
| + | "aliases": ["1"], | ||
| + | "description": "The ID portion of the URL. Example: 4ce2b6b82c47d in https://www.bfi.org.uk/films-tv-people/4ce2b6b82c47d. This parameter is optional if Wikidata property P4438 exists, but required if not.", | ||
| + | "type": "string", | ||
| + | "required": false, | ||
| + | "default": "Wikidata property P4438" | ||
| + | }, | ||
| + | "title": { | ||
| + | "label": "title", | ||
| + | "aliases": ["name", "2"], | ||
| + | "description": "Title of film or television series title, or name of person, used as the link text. This parameter is optional; it defaults to the Wikipedia article name, without any disambiguation such as \"(film)\" or \"(film)\".", | ||
| + | "type": "string", | ||
| + | "required": false, | ||
| + | "default": "{{PAGENAMEBASE}}" | ||
| + | } | ||
| + | }, | ||
| + | "paramOrder": [ | ||
| + | "id", | ||
| + | "title" | ||
| + | ] | ||
| + | } | ||
| + | </templatedata> | ||
| − | <includeonly> | + | <includeonly>{{#ifeq:{{SUBPAGENAME}}|sandbox|| |
| − | <!-- Categories and interwikis go | + | <!-- Categories go here and interwikis go in Wikidata. --> |
| − | [[Category:Film external link templates | + | [[Category:Film external link templates]] |
| − | </includeonly> | + | [[Category:Television external link templates]] |
| + | [[Category:People and person external link templates]] | ||
| + | [[Category:External link templates using Wikidata]] | ||
| + | }}</includeonly> | ||
Revision as of 03:44, 30 July 2018
| This template uses Lua: |
Template:BFI displays an external link to a page in the "Films, TV and people" section of the British Film Institute (BFI) website. It is intended for use in the external links section of an article.
Usage
Unnamed parameters:
Named parameters:
Using Wikidata property P4438:
Examples
Film
URL:
- https://www.bfi.org.uk/films-tv-people/4ce2b6b82c47d
Usage:
Output:
- The 39 Steps at the British Film InstituteScript error: No such module "EditAtWikidata".Template:WikidataCheck
Person
URL:
- https://www.bfi.org.uk/films-tv-people/4ce2b9ee3449d
Usage:
Output:
- Alfred Hitchcock at the British Film InstituteScript error: No such module "EditAtWikidata".Template:WikidataCheck
No ID in template or Wikidata
- Usage
- Template:Tlcw
- Output
-
- Template:PAGENAMEBASE at the British Film InstituteScript error: No such module "EditAtWikidata".Template:WikidataCheck
TemplateData
TemplateData for BFI
This template displays an external link to a page in the "Films, TV and people" section of the British Film Institute (BFI) website. It is intended for use in the external links section of an article.
| Parameter | Description | Type | Status | |
|---|---|---|---|---|
| id | id 1 | The ID portion of the URL. Example: 4ce2b6b82c47d in https://www.bfi.org.uk/films-tv-people/4ce2b6b82c47d. This parameter is optional if Wikidata property P4438 exists, but required if not.
| String | optional |
| title | title name 2 | Title of film or television series title, or name of person, used as the link text. This parameter is optional; it defaults to the Wikipedia article name, without any disambiguation such as "(film)" or "(film)".
| String | optional |