Difference between revisions of "Template:AFI film/doc"

From blackwiki
Jump to navigation Jump to search
blackwiki>Zyxw
(update documentation, add TemplateData)
m (8 revisions imported)
 
(6 intermediate revisions by 6 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. -->
 +
{{High-use| 4,000 }}
 +
{{Uses Wikidata|P3593}}
 +
{{Lua|Module:EditAtWikidata}}
  
This template is used to generate an external link to a web page at the ''[[AFI Catalog of Feature Films]]'', published by the [[American Film Institute]].
+
'''{{NAMESPACE}}:{{BASEPAGENAME}}''' displays an external link to a web page at the ''[[AFI Catalog of Feature Films]]'', published by the [[American Film Institute]]. It is intended for use in the [[Wikipedia:External links|external links]] section of an article.
  
 
== Usage ==
 
== Usage ==
 
Unnamed parameters:
 
Unnamed parameters:
* <code><nowiki>{{</nowiki>{{BASEPAGENAME}} | ''ID'' }}</code>
+
: <code><nowiki>{{</nowiki>{{BASEPAGENAME}} | ''ID'' }}</code>
* <code><nowiki>{{</nowiki>{{BASEPAGENAME}} | ''ID'' | ''TITLE'' }}</code>
+
: <code><nowiki>{{</nowiki>{{BASEPAGENAME}} | ''ID'' | ''TITLE'' }}</code>
  
 
Named parameters:
 
Named parameters:
* <code><nowiki>{{</nowiki>{{BASEPAGENAME}} | id= ''ID'' }}</code>
+
: <code><nowiki>{{</nowiki>{{BASEPAGENAME}} | id= ''ID'' }}</code>
* <code><nowiki>{{</nowiki>{{BASEPAGENAME}} | id= ''ID'' | title= ''TITLE'' }}</code>
+
: <code><nowiki>{{</nowiki>{{BASEPAGENAME}} | id= ''ID'' | title= ''TITLE'' }}</code>
 +
 
 +
Using [[Wikidata]] property [[d:Property:P3593|P3593]]:
 +
: <code><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>}}</nowiki></code>
 +
: <code><nowiki>{{</nowiki>{{BASEPAGENAME}} | title= ''TITLE'' <nowiki>}}</nowiki></code>
  
 
== Instructions ==
 
== Instructions ==
# Search [http://www.afi.com/members/catalog/search.aspx?s= AFI Catalog] for the film title you want, and click on the correct link to go to that film's page.
+
# Search [https://catalog.afi.com/Catalog/Showcase AFI Catalog] for the film title you want, and click on the correct link to go to that film's page.
 
# The page [[URL]] should look like this:
 
# The page [[URL]] should look like this:
#: <code><nowiki>http://www.afi.com/members/catalog/DetailView.aspx?s=&Movie=</nowiki>{{Hilite|#####}}</code>
+
#: <code><nowiki>https://catalog.afi.com/Catalog/moviedetails/</nowiki>{{Hilite|#####}}</code>
 +
#: or <code><nowiki>http://www.afi.com/members/catalog/DetailView.aspx?s=&Movie=</nowiki>{{Hilite|#####}}</code>
 
#: where "<code>#####</code>" indicates a number.
 
#: where "<code>#####</code>" indicates a number.
 
# Copy {{em|only}} that number. Add the following text to the '''External links''' section:
 
# Copy {{em|only}} that number. Add the following text to the '''External links''' section:
#: <code><nowiki>* {{</nowiki>AFI film | ##### | ''TITLE'' }}</code>
+
#: <code><nowiki>* {{</nowiki>{{BASEPAGENAME}} | ##### | ''TITLE'' }}</code>
#: or <code><nowiki>* {{</nowiki>AFI film | id= ##### | title= ''TITLE'' }}</code>
+
#: or <code><nowiki>* {{</nowiki>{{BASEPAGENAME}} | id= ##### | title= ''TITLE'' }}</code>
 
#: where <code>#####</code> is the number you've copied,
 
#: where <code>#####</code> is the number you've copied,
 
#: and <code>''TITLE''</code> is the title of the film (default is the article's name).
 
#: and <code>''TITLE''</code> is the title of the film (default is the article's name).
  
== Example ==
+
== Examples ==
; Film
 
# For ''[[Quantum of Solace]]'', the AFI Catalog page URL is:
 
#: <code><nowiki>http://www.afi.com/members/catalog/DetailView.aspx?s=&Movie=</nowiki>{{Hilite|64729}}</code>
 
# Copy <code>64729</code> and add it to this template, ''i.e.'':
 
#: <code><nowiki>{{AFI film | 64729 | Quantum of Solace }}</nowiki></code>
 
#: or <code><nowiki>{{AFI film | id= 64729 | title= Quantum of Solace }}</nowiki></code>
 
# This will display as:
 
#: {{AFI film | 64729 | Quantum of Solace }}
 
  
== See also ==
+
=== Unnamed parameters ===
Similar film title templates:
+
''URL:''
* {{tl|IMDb title}}
+
: <kbd><nowiki>https://catalog.afi.com/Catalog/moviedetails/</nowiki>{{Hilite|64729}}</kbd>
* {{tl|AllMovie title}}
+
: <kbd><nowiki>http://www.afi.com/members/catalog/DetailView.aspx?s=&Movie=</nowiki>{{Hilite|64729}}</kbd>
* {{tl|TCMdb title}}
+
 
 +
''Usage:''
 +
: <code><nowiki>* {{</nowiki>{{BASEPAGENAME}} | 64729 | Quantum of Solace <nowiki>}}</nowiki></code>
 +
 
 +
''Output:''
 +
:* {{{{BASEPAGENAME}} | 64729 | Quantum of Solace }}
 +
 
 +
=== Named parameters ===
 +
''URL:''
 +
: <kbd><nowiki>https://catalog.afi.com/Catalog/moviedetails/</nowiki>{{Hilite|52231}}</kbd>
 +
: <kbd><nowiki>http://www.afi.com/members/catalog/DetailView.aspx?s=&Movie=</nowiki>{{Hilite|52231}}</kbd>
 +
 
 +
''Usage:''
 +
: <code><nowiki>* {{</nowiki>{{BASEPAGENAME}} | id= 52231 | title= The Incredible Shrinking Man <nowiki>}}</nowiki></code>
 +
 
 +
''Output:''
 +
:* {{{{BASEPAGENAME}} | id= 52231 | title= The Incredible Shrinking Man }}
 +
 
 +
=== No ID in template or Wikidata ===
 +
''Usage:''
 +
: <code><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>}}</nowiki></code>
 +
 
 +
''Output:''
 +
: {{ {{BASEPAGENAME}} }}
  
==Template data==
+
==TemplateData==
{{TemplateDataHeader}}
+
{{TemplateData header}}
 
<templatedata>
 
<templatedata>
 
{
 
{
         "description": "This template is used to generate an external link to a web page at the AFI Catalog of Feature Films, published by the American Film Institute.",
+
         "description": "This template displays an external link to a web page at the AFI Catalog of Feature Films, published by the American Film Institute. It is intended for use in the external links section of an article.",
 
         "params": {
 
         "params": {
 
                 "id": {
 
                 "id": {
 +
                        "aliases" : [ "1" ],
 
                         "label": "ID",
 
                         "label": "ID",
                         "description": "ID number used in the URL of the title's page at the AFI Catalog.",
+
                         "description": "The \"id\" parameter (or unnamed parameter \"1\") should contain the ID portion of the URL. Example: 64729 is the ID in https://catalog.afi.com/Catalog/moviedetails/64729 or http://www.afi.com/members/catalog/DetailView.aspx?s=&Movie=64729. This parameter is optional if Wikidata property P3593 exists, but required if not.",
 
                         "type": "number",
 
                         "type": "number",
                        "required": true,
+
"default": "Wikidata property P3593",
                         "aliases" : [ "1" ]
+
                         "required": false
 
                 },
 
                 },
 
                 "title": {
 
                 "title": {
 +
                        "aliases" : [ "2" ],
 
                         "label": "Title",
 
                         "label": "Title",
                         "description": "Name of the title. If not specified it defaults to article's {{PAGENAME}}, without any disambiguation such as (film).",
+
                         "description": "The \"title\" parameter (or unnamed parameter \"2\") may be used to specify the film title, which is displayed in italic type in the link text. This parameter is optional; it defaults to the Wikipedia article name, without any disambiguation such as \"(film)\".",
 
                         "type": "string",
 
                         "type": "string",
                         "required": false,
+
                         "default": "{{PAGENAMEBASE}}",
                         "aliases" : [ "2" ]
+
                         "required": false
 
                 }
 
                 }
        }
+
},
 +
"paramOrder": [
 +
"id",
 +
"title"
 +
]
 
}
 
}
 
</templatedata>
 
</templatedata>
  
<includeonly>{{#ifeq:{{SUBPAGENAME}}|sandbox||
+
== See also ==
 +
Similar film title templates:
 +
* {{tl|IMDb title}}
 +
* {{tl|AllMovie title}}
 +
* {{tl|TCMDb title}}
 +
* {{tl|BFI}}
 +
* {{tl|Rotten Tomatoes}}
 +
* {{tl|Metacritic film}}
 +
* {{tl|Mojo title}}
 +
 
 +
<includeonly>{{Sandbox other||
 
<!-- Categories go here and interwikis go in Wikidata. -->
 
<!-- Categories go here and interwikis go in Wikidata. -->
 
[[Category:Film external link templates]]
 
[[Category:Film external link templates]]
 +
[[Category:External link templates using Wikidata]]
 
}}</includeonly>
 
}}</includeonly>

Latest revision as of 16:43, 15 October 2020

Template:Uses Wikidata

Template:AFI film displays an external link to a web page at the AFI Catalog of Feature Films, published by the American Film Institute. It is intended for use in the external links section of an article.

Usage

Unnamed parameters:

{{AFI film | ID }}
{{AFI film | ID | TITLE }}

Named parameters:

{{AFI film | id= ID }}
{{AFI film | id= ID | title= TITLE }}

Using Wikidata property P3593:

{{AFI film}}
{{AFI film | title= TITLE }}

Instructions

  1. Search AFI Catalog for the film title you want, and click on the correct link to go to that film's page.
  2. The page URL should look like this:
    https://catalog.afi.com/Catalog/moviedetails/#####
    or http://www.afi.com/members/catalog/DetailView.aspx?s=&Movie=#####
    where "#####" indicates a number.
  3. Copy only that number. Add the following text to the External links section:
    * {{AFI film | ##### | TITLE }}
    or * {{AFI film | id= ##### | title= TITLE }}
    where ##### is the number you've copied,
    and TITLE is the title of the film (default is the article's name).

Examples

Unnamed parameters

URL:

https://catalog.afi.com/Catalog/moviedetails/64729
http://www.afi.com/members/catalog/DetailView.aspx?s=&Movie=64729

Usage:

* {{AFI film | 64729 | Quantum of Solace }}

Output:

Named parameters

URL:

https://catalog.afi.com/Catalog/moviedetails/52231
http://www.afi.com/members/catalog/DetailView.aspx?s=&Movie=52231

Usage:

* {{AFI film | id= 52231 | title= The Incredible Shrinking Man }}

Output:

No ID in template or Wikidata

Usage:

{{AFI film}}

Output:

Template:PAGENAMEBASE at the American Film Institute CatalogScript error: No such module "EditAtWikidata".

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 AFI film

This template displays an external link to a web page at the AFI Catalog of Feature Films, published by the American Film Institute. It is intended for use in the external links section of an article.

Template parameters

ParameterDescriptionTypeStatus
IDid 1

The "id" parameter (or unnamed parameter "1") should contain the ID portion of the URL. Example: 64729 is the ID in https://catalog.afi.com/Catalog/moviedetails/64729 or http://www.afi.com/members/catalog/DetailView.aspx?s=&Movie=64729. This parameter is optional if Wikidata property P3593 exists, but required if not.

Default
Wikidata property P3593
Numberoptional
Titletitle 2

The "title" parameter (or unnamed parameter "2") may be used to specify the film title, which is displayed in italic type in the link text. This parameter is optional; it defaults to the Wikipedia article name, without any disambiguation such as "(film)".

Default
{{PAGENAMEBASE}}
Stringoptional

See also

Similar film title templates: