Template:IMDb episode: Difference between revisions
m (1 revision imported) |
m (1 revision imported) |
||
(2 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
{{#if: {{{1|{{{id | <includeonly>{{#if: {{{1|{{{id|}}}}}} {{#property:P345}} | ||
| [https://www.imdb.com/title/{{#if: {{{1|{{{id|}}}}}} | |||
| [https://www.imdb.com/title/{{#if: {{{1|{{{id | |||
| tt{{Trim|{{{1|{{{id}}}}}}}} | | tt{{Trim|{{{1|{{{id}}}}}}}} | ||
| {{First word|1={{#property:P345}}|sep=,}} | | {{First word|1={{#property:P345}}|sep=,}} | ||
}}/ | }}/ {{#if: {{{2|{{{episode|}}}}}} | ||
| {{{2|{{{episode}}}}}} | | "{{{2|{{{episode}}}}}}" | ||
| {{ | | {{#invoke:Infobox television episode|above_title|no_bold=yes}} | ||
}} | }}{{#if: {{{3|{{{description|}}}}}} | {{Spaces}}{{{3|{{{description}}}}}} }}] at [[IMDb (identifier)|IMDb]]<!-- | ||
-->{{EditAtWikidata|{{{1|{{{id|}}}}}}|pid=P345}} | |||
| <span class="error">{{[[Template:IMDb episode|IMDb episode]]}} template missing ID and not present in Wikidata.</span> | | <span class="error">{{[[Template:IMDb episode|IMDb episode]]}} template missing ID and not present in Wikidata.</span> | ||
}}<!-- Tracking categories | |||
}}<noinclude> | -->{{#invoke:Check for unknown parameters|check|unknown={{Main other|[[Category:Pages using IMDb episode with unknown parameters|_VALUE_{{PAGENAME}}]]}}|preview=Page using [[Template:IMDb episode]] with unknown parameter "_VALUE_"|showblankpositional=1| 1 | 2 | 3 | description | episode | id }}<!-- | ||
-->{{Main other|{{#if: {{{2|{{{episode|}}}}}} | {{#ifeq: {{{2|{{{episode|}}}}}} | {{PAGENAMEBASE}} || {{#switch: {{Wikidata|property|raw|P31}} <!-- instance of --> | |||
| Q21664088 <!-- two-part episode --> | |||
| Q50062923 <!-- three-part episode --> | |||
| Q50914552 <!-- four-part episode --> | |||
| Q99079902 <!-- five-part episode --> | |||
| Q123186929 <!-- six-part episode --> | |||
| Q125359117 <!-- animated two-part episode --> | |||
| Q125359123 <!-- animated three-part episode --> | |||
| Q125359129 <!-- animated four-part episode --> | |||
| Q125359137 <!-- animated five-part episode --><!-- Multi-part usages are valid so shouldn't be tracked. --> | |||
| Q55422400 <!-- Sarah Jane Smith serial --> = <!-- don't categorize --> | |||
| #default = [[Category:Pages using IMDb episode with a different name]] | |||
}} }} }} }}<!-- | |||
-->{{#if: {{{1|{{{id|}}}}}} | {{#switch: {{Wikidata|property|raw|P31}} <!-- instance of --> | |||
| Q21664088 <!-- two-part episode --> | |||
| Q50062923 <!-- three-part episode --> | |||
| Q50914552 <!-- four-part episode --> | |||
| Q99079902 <!-- five-part episode --> | |||
| Q123186929 <!-- six-part episode --> | |||
| Q125359117 <!-- animated two-part episode --> | |||
| Q125359123 <!-- animated three-part episode --> | |||
| Q125359129 <!-- animated four-part episode --> | |||
| Q125359137 <!-- animated five-part episode --> | |||
| Q55422400 <!-- Sarah Jane Smith serial --> = <!-- don't categorize --> | |||
| #default = {{WikidataCheck|property=P345|value=tt{{{1|{{{id|}}}}}}|category=IMDb episode ID|nocatsame=1}} | |||
}} }}<!-- | |||
--></includeonly><noinclude> | |||
{{Documentation}} | {{Documentation}} | ||
</noinclude> | </noinclude> |
Latest revision as of 07:04, 27 August 2024
This template is used on approximately 9,500 pages and changes may be widely noticed. Test changes in the template's /sandbox or /testcases subpages, or in your own user subpage. Consider discussing changes on the talk page before implementing them. |
This template uses Lua: |
Template:IMDb episode displays an external link to a television episode page at the Internet Movie Database (IMDb). It is used exclusively for episodes. This template is intended for use in the external links section of an article.
- To link an episode list, use {{IMDb episodes}} instead.
- To link a work (film/movie, TV or Web program/series, video game, etc.), use {{IMDb title}} instead.
- To link a person (actor, actress, etc.), use {{IMDb name}} instead.
Usage
Unnamed parameters:
{{IMDb episode | ID }}
{{IMDb episode | ID | EPISODE }}
Named parameters:
{{IMDb episode | id= ID }}
{{IMDb episode | id= ID | episode= EPISODE }}
Using Wikidata property (P345):
{{IMDb episode}}
{{IMDb episode | episode= EPISODE }}
Options
The required parameter is just the ID number (for backward compatibility, the parameter can be named id
) and the template then uses the article title as the anchor text:
* {{IMDb episode | ID }}
To have the link text be other than the article name, use second parameter (for backward compatibility, it can be named Episode
):
* {{IMDb episode | ID | Episode }}
Note that the examples include the *
for a bulleted list since this is most likely to be used in an "External links" section.
Detailed instructions
- Copy and paste one of the options above into the article.
- Go to https://www.imdb.com, select TV episode in the search drop down menu and search for the episode you want (say, One for the Road; you'll reach
https://www.imdb.com/find?s=ep&q=One+for+the+Road&x=13&y=10
). - Click on the correct "One for the Road" in the list:
- You then reach the page with URL looking like
https://www.imdb.com/title/tt0539826/
(or other 7-digit number) - Copy only that number (here, 0539826), omitting the
tt
part, but keep any leading zeros (though IMDb currently seems to be able to add them as needed) - Replace ID in the template code with the number
- For the first option above, you'll then have
* {{IMDb episode | 0539826 }}
resulting in:
- Note that the link text is the same as the title of the page the template is used on; outside the page One for the Road, use the second option:
- Replace ID with the number and Episode with
One for the Road
* {{IMDb episode | 0539826 | One for the Road }}
results in:
- For the first option above, you'll then have
Examples
ID in Wikidata
Usage in the article Perchance to Dream (The Twilight Zone):
* {{IMDb episode}}
* {{IMDb episode | episode= Perchance to Dream }}
Output:
No ID in template or Wikidata
Usage:
* {{IMDb episode}}
Output:
No description.
Parameter | Description | Type | Status | |
---|---|---|---|---|
1 | 1 | no description | Unknown | optional |
2 | 2 | no description | Unknown | optional |
3 | 3 | no description | Unknown | optional |
episode | episode | no description | Unknown | optional |
description | description | no description | Unknown | optional |
See also
- {{IMDb title|quotes=
Error: The retired template {{Template:IMDb episode}} has been transcluded; see mw:Help:Magic words#Other for details. To fix this, use only the code {{=}} to generate the = character.yes}} for short films that are not actually episodes of series