Template:IMDb name: Difference between revisions
meta>Zyxw only display EditAtWikidata link if Wikidata property exists, tested in /sandbox |
Quantumhusky (talk | contribs) m 1 revision imported |
||
(7 intermediate revisions by 4 users not shown) | |||
Line 1: | Line 1: | ||
[https://www.imdb.com/{{#if: {{{1|{{{id|}}}}}} | [https://www.imdb.com/{{#if: {{{1|{{{id|}}}}}} | ||
| name/{{# | | name/{{#if:{{#invoke:ustring|match|1={{{1|{{{id}}}}}}|2=^nm}} | ||
| {{Trim|{{{1|{{{id}}}}}}}}/ | |||
| | | nm{{padleft:{{{1|{{{id}}}}}}|7}}/ | ||
}} | }} | ||
| {{#if: {{#property:P345}} | | {{#if: {{#property:P345}} | ||
| name/{{First word|1={{#property:P345}}|sep=,}} | | name/{{First word|1={{#property:P345}}|sep=,}}/ | ||
| | | find?q={{urlencode:{{PAGENAME}}}}&s=nm | ||
}} | }} | ||
}} | }}{{#if: {{{1|}}} {{{id|}}} {{#property:P345}} | {{#switch: {{lc:{{{section|}}}}} | ||
| award | awards = awards Awards for | biography | bio = bio Biography for | | award | awards = awards Awards for | biography | bio = bio Biography for | ||
}} {{#if: {{{2|{{{name|}}}}}} | }}}} {{#if: {{{2|{{{name|}}}}}} | ||
| {{{2|{{{name}}}}}} | | {{{2|{{{name}}}}}} | ||
| {{PAGENAMEBASE}} | | {{PAGENAMEBASE}} | ||
}}] | }}] at [[IMDb]]<includeonly>{{#if: {{{1|{{{id|}}}}}}{{#property:P345}} | ||
| {{EditAtWikidata|pid=P345|{{{1|{{{id|}}}}}}}} | | {{EditAtWikidata|pid=P345|nbsp=yes|{{{1|{{{id|}}}}}}}} | ||
| {{Main other|[[Category:IMDb template with no id set]]}} | | {{Main other|[[Category:IMDb template with no id set]]}} | ||
}}{{#switch:{{#invoke:string2|matchAny|^nm.........|^nm.......|nm|.........|source={{{1|{{{id}}}}}}|plain=false}} | |||
| | | 1 | 3 = {{Main other|[[Category:IMDb template with invalid id set]]}}{{preview warning|IMDb ID starting with ''nm'' should be followed by seven or eight digits, such as ''nm0000567'' or ''nm12345678''}} | ||
| 4 = {{Main other|[[Category:IMDb template with invalid id set]]}}{{preview warning|IMDb ID should not contain more than eight digits}} | |||
}}</includeonly><noinclude> | |||
{{documentation}} | {{documentation}} | ||
</noinclude> | </noinclude> |
Latest revision as of 01:02, 7 June 2021
This template is used on approximately 154,000 pages. To avoid major disruption and server load, any changes should be tested in the template's /sandbox or /testcases subpages, or in your own user subpage. The tested changes can be added to this page in a single edit. Consider discussing changes on the talk page before implementing them. |
This template uses Lua: |
This template is used to generate an external link to a web page for a person in the Internet Movie Database. It is intended for use in the external links section of an article.
- For a work (film/movie, TV or Web program/series, video game, etc.), use {{IMDb title}}.
- For a specific TV episode or Web series episode, use {{IMDb episode}}.
- For an episode list, use {{IMDb episodes}}.
- For a company, use {{IMDb company}}.
- For an event, use {{IMDb event}}.
Usage
If the subject of the Wikipedia article is the same as the IMDb page, only ID number is required. The template then uses the Wikipedia article name as the anchor text.
{{IMDb name | ID }}
{{IMDb name | id= ID }}
To have the link text be other than the article name, use second parameter. This is necessary when adding an IMDb link to an article about somebody or something other than the linked person (for example, if you include the IMDb link for Bette Davis in the Joan Crawford article, you must specify Bette Davis's name as the text for the link).
{{IMDb name | ID | NAME }}
{{IMDb name | id= ID | name= NAME }}
The parameter |section=
can be set to award
(alternatively awards
) or bio
(alternatively biography
) to link to the awards or biography section for that person.
{{IMDb name | ID | NAME | section= SECTION }}
{{IMDb name | id= ID | name= NAME | section= SECTION }}
The ID number may be omitted if the article's Wikidata item includes property (P345).
{{IMDb name}}
{{IMDb name | name= NAME }}
{{IMDb name | name= NAME | section= SECTION }}
Instructions and examples
- Go to IMDb.com and search for the person you want (say, Marlon Brando; you'll reach
https://www.imdb.com/find?q=Marlon+Brando&s=all
). This can also be done on the Wikipedia page by previewing{{IMDb name}}
and clicking that link ( https://www.imdb.com/find?q=Marlon+Brando&s=nm ). - Click on the correct name in the list (for the actor Marlon Brando, this will bring up the page
https://www.imdb.com/name/nm0000008/
) - Copy only the 7- or 8-digit number (here, "
0000008
"), omitting the "nm
" but keep all the leading zeros. - Replace "
ID
" in the template code with the number- For the first option above, you'll then have
- Replace "
ID
" with the number and "Name
" with "Marlon Brando
"* {{IMDb name | 0000008 | Marlon Brando }}
results in:
- The parameter
|section=
can be set toaward
(alternativelyawards
) orbio
(alternativelybiography
) to link to the awards or biography section for that person.* {{IMDb name | 0000008 | Marlon Brando | section= awards }}
gives:* {{IMDb name | 0000008 | Marlon Brando | section= bio }}
gives:
TemplateData
TemplateData for IMDb name
This template is used to generate an external link to a web page for a person in the Internet Movie Database.
Parameter | Description | Type | Status | |
---|---|---|---|---|
ID | id 1 | The IMDb ID for the target page. This parameter is optional if Wikidata property P345 contains an ID starting with nm, but required if not.
| Number | optional |
Name | name 2 | Name to be displayed as link text. Defaults to the Wikipedia article name, without any disambiguation such as (actor).
| String | optional |
Section | section | IMDb article section. Set to "award" or "awards" to link to the awards section. Set to "bio" or "biography" to link to the biography section. | String | optional |
Tracking categories
See also
- Template:IMDb, a list of related templates
- Wikipedia:IMDb
Similar person templates
- {{AllMovie name}}
- {{TCMDb name}}
- {{BFI}}