Tags: mobile edit mobile web edit |
|
| Line 1: |
Line 1: |
| <includeonly>[https://www.imdb.com/{{#if: {{{1|{{{id|}}}}}} | | <includeonly> |
| | title/{{#if: {{#invoke:ustring|match|1={{{1|{{{id}}}}}}|2=^tt}} | | [https://www.imdb.com/{{#if: {{{1|{{{id|}}}}}} |
| | {{Trim|{{{1|{{{id}}}}}}}}/
| | | title/{{#if: {{#ifexpr: {{#pos:{{{1|{{{id|}}}}}}|tt}} = 0}} |
| | tt{{padleft:{{{1|{{{id}}}}}}|7}}/
| | | {{padleft:{{{1|{{{id}}}}}}|9|0}} |
| }}
| | | tt{{padleft:{{{1|{{{id|}}}}}}|7|0}} |
| | {{#if: {{#property:P345|from={{{qid|}}}}}
| |
| | title/{{First word|1={{#property:P345|from={{{qid|}}}}}|sep=,}}/
| |
| | find?q={{urlencode:{{PAGENAMEBASE}}}}&s=tt
| |
| }} | | }} |
| | | find?q={{urlencode:{{PAGENAMEBASE}}}}&s=tt |
| }}{{#switch: {{lc:{{{section|}}}}} | | }}{{#switch: {{lc:{{{section|}}}}} |
| | award | awards = awards Awards for | | | award | awards = awards Awards for |
| | cast = fullcredits Full cast and crew of | | | cast = fullcredits Full cast and crew of |
| }} {{Trim|{{#if: {{{quotes|}}} | "{{If empty|{{{2|}}}|{{{title|}}}|{{PAGENAMEBASE}}}}" | ''{{If empty|{{{2|}}}|{{{title|}}}|{{PAGENAMEBASE}}}}'' }} {{{3|{{{description|}}}}}}}}] at {{#if: {{{link_hide|}}}| IMDb | [[IMDb (identifier)|IMDb]] }}<!--
| | }} {{#if: {{{quotes|}}} |
| -->{{EditAtWikidata|pid=P345}}<!-- Tracking categories
| | | "{{{title|{{{2|{{PAGENAMEBASE}}}}}}}}" |
| -->{{#invoke:Check for unknown parameters|check|unknown={{Main other|[[Category:Pages using IMDb title with unknown parameters|_VALUE_{{PAGENAME}}]]}}|preview=Page using [[Template:IMDb title]] with unknown parameter "_VALUE_"|showblankpositional=1| 1 | 2 | 3 | description | id | link_hide | qid | quotes | section | title }}<!--
| | | ''{{{title|{{{2|{{PAGENAMEBASE}}}}}}}}'' |
| -->{{#switch: {{#invoke:String2|matchAny|^tt.........|^tt.......|tt|.........|source={{{1|{{{id}}}}}}|plain=false}}<!--
| | }} {{{3|{{{description|}}}}}}] at {{#if: {{{link_hide|}}} | IMDb | [[IMDb (identifier)|IMDb]] }} |
| -->| 1 | 3 = {{Main other|[[Category:IMDb template with invalid id set]]}}{{Preview warning|IMDb ID starting with ''tt'' should be followed by seven or eight digits, such as ''tt0000567'' or ''tt12345678''}}<!--
| | </includeonly><noinclude> |
| -->| 4 = {{Main other|[[Category:IMDb template with invalid id set]]}}{{Preview warning|IMDb ID should not contain more than eight digits}}<!--
| | |
| -->}}<!--
| | == Usage == |
| -->{{#if: {{{1|{{{id|}}}}}} {{#property:P345}} || {{Preview warning|[[Template:IMDb title]] is missing ID and not present in Wikidata.}}{{Main other|[[Category:Pages using IMDb title with no id set]]}} }}<!--
| | This template generates a link to an IMDb page for a specific title or search query. |
| -->{{#switch: {{Wikidata|property|raw|P31}} <!-- instance of -->
| | |
| | Q21191270 <!-- television series episode -->
| | === Example === |
| | Q21664088 <!-- two-part episode -->
| | <syntaxhighlight lang="mediawiki"> |
| | Q50062923 <!-- three-part episode -->
| | {{IMDb title|id=tt1234567|title=Example Movie|section=cast|description=Full cast and crew}} |
| | Q50914552 <!-- four-part episode -->
| | </syntaxhighlight> |
| | Q99079902 <!-- five-part episode -->
| | |
| | Q123186929 <!-- six-part episode -->
| | === Parameters === |
| | Q55422400 <!-- Sarah Jane Smith serial -->
| | * `id` or `1` - IMDb title ID (e.g., tt1234567). If blank, performs a search for the page name. |
| | Q61220733 = <!-- Star Trek episode --> [[Category:Pages using IMDb title instead of IMDb episode]]{{Preview warning|[[Template:IMDb episode]] should be used for television episodes}}
| | * `title` or `2` - Title text to display. |
| | Q3464665 = <!-- television series season --> [[Category:Pages using IMDb title instead of IMDb episodes]]{{Preview warning|[[Template:IMDb episodes]] should be used for television seasons}}
| | * `section` - IMDb section (e.g., `cast`, `awards`). |
| | Q13406463 = <!-- Wikimedia list article --> [[Category:Pages using IMDb title instead of IMDb episodes]]{{Preview warning|[[Template:IMDb episodes]] should be used for list of episodes}}
| | * `description` or `3` - Additional descriptive text. |
| }}<!--
| | * `link_hide` - Hides the word "IMDb" when set. |
| -->{{#ifeq: {{Wikidata|property|raw|P360}} <!-- is a list of --> | Q21191270 | [[Category:Pages using IMDb title instead of IMDb episodes]]{{Preview warning|[[Template:IMDb episodes]] should be used for list of television episodes}} }}<!--
| | |
| -->{{#if: {{{1|{{{id|}}}}}} | {{WikidataCheck|property=P345|value={{#if: {{#invoke:ustring|match|1={{{1|{{{id}}}}}}|2=^tt}} | {{Trim|{{{1|{{{id|}}}}}}}} | tt{{padleft:{{Trim|{{{1|{{{id|}}}}}}}}|7}}}}|category=IMDb title ID|qid={{{qid|}}}|nocatsame=1}} }}<!--
| | === Result === |
| --></includeonly><noinclude>
| | - With ID: Links to a specific title page on IMDb. |
| {{Documentation}}
| | - Without ID: Performs a search query for the page title on IMDb. |
| | |
| | == Notes == |
| | * IMDb title IDs **must** start with `tt` followed by 7 or 8 digits (e.g., `tt1234567`). |
| | * Invalid IDs are not processed, and a search query is generated instead. |
| | |
| </noinclude> | | </noinclude> |
| {{no-index-template}}
| |
Usage
This template generates a link to an IMDb page for a specific title or search query.
Example
{{IMDb title|id=tt1234567|title=Example Movie|section=cast|description=Full cast and crew}}
Parameters
- `id` or `1` - IMDb title ID (e.g., tt1234567). If blank, performs a search for the page name.
- `title` or `2` - Title text to display.
- `section` - IMDb section (e.g., `cast`, `awards`).
- `description` or `3` - Additional descriptive text.
- `link_hide` - Hides the word "IMDb" when set.
Result
- With ID: Links to a specific title page on IMDb.
- Without ID: Performs a search query for the page title on IMDb.
Notes
- IMDb title IDs **must** start with `tt` followed by 7 or 8 digits (e.g., `tt1234567`).
- Invalid IDs are not processed, and a search query is generated instead.