Difference between revisions of "Template:BFI/doc"

From blackwiki
Jump to navigation Jump to search
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:
{{Documentation subpage}}
+
<!-- Categories go at the bottom of this page and interwikis go in Wikidata. -->
<!-- Categories and interwikis go at the bottom of this page. -->
+
{{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 ==
This template is for linking a film article to the page of that film at the [[British Film Institute]]'s "Explore film...' database. It should appear in the External links section.
+
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 }}
  
<pre>* {{BFI Explore|id=|title=}}</pre>
+
=== 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 }}
  
The template has the following parameters:
+
=== No ID in template or Wikidata ===
{| class="wikitable"
+
; Usage
|-
+
: {{tlcw|a=1|{{BASEPAGENAME}} }}
! Parameter
+
; Output
! Notes
+
:* {{{{BASEPAGENAME}} }}
|-
 
| '''id'''
 
| Programme id given after http://www.bfi.org.uk/films-tv-people/. For example, the ''[[The Admirable Crichton (1957 film)]]'' entry is at http://www.bfi.org.uk/films-tv-people/4ce2b6b26838c and the id is 4ce2b6b26838c.
 
|-
 
| '''title'''
 
| Programme name, for the above example this would be The Admirable Crichton. The title is automatically formatted, i.e. if left "title=", it will display the name of the article. Consequently, film articles with an explanatory addition to the title (e.g. ''The Admirable Crichton (film)'') should have the clean title entered, in order for the explanation not to be displayed.
 
|}
 
  
== See also ==
+
== TemplateData ==
*{{tl|Bfidb title}}   
+
{{TemplateData header}}
*{{tl|Bfidb individual credit}}
+
<templatedata>
*{{tl|Bfidb series}}
+
{
 +
  "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 here: -->
+
<!-- Categories go here and interwikis go in Wikidata. -->
[[Category:Film external link templates|BFI Explore]]
+
[[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

Template:Uses Wikidata

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:

Template:Tlcw
Template:Tlcw

Named parameters:

Template:Tlcw
Template:Tlcw
Template:Tlcw

Using Wikidata property P4438:

Template:Tlcw
Template:Tlcw
Template:Tlcw

Examples

Film

URL:

https://www.bfi.org.uk/films-tv-people/4ce2b6b82c47d

Usage:

Template:Tlcw

Output:

Person

URL:

https://www.bfi.org.uk/films-tv-people/4ce2b9ee3449d

Usage:

Template:Tlcw

Output:

No ID in template or Wikidata

Usage
Template:Tlcw
Output

TemplateData

This is the TemplateData documentation for this template used by VisualEditor and other tools; see the monthly parameter usage report for this template.

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.

Template parameters

ParameterDescriptionTypeStatus
idid 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.

Default
Wikidata property P4438
Stringoptional
titletitle 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)".

Default
{{PAGENAMEBASE}}
Stringoptional