Template:IMDb title: Difference between revisions

From WikiMD's Wellness Encyclopedia

CSV import
Tags: mobile edit mobile web edit
 
No edit summary
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
<includeonly>[https://www.imdb.com/{{#if: {{{1|{{{id|}}}}}}
<includeonly>
   | title/{{#if: {{#invoke:ustring|match|1={{{1|{{{id}}}}}}|2=^tt}}
{{#if: {{{id|}}} |
    | {{Trim|{{{1|{{{id}}}}}}}}/
   [https://www.imdb.com/title/tt{{{id}}}/ {{{title|IMDb}}}]
    | tt{{padleft:{{{1|{{{id}}}}}}|7}}/
}}
    }}
</includeonly>
  | {{#if: {{#property:P345|from={{{qid|}}}}}
<noinclude>
    | title/{{First word|1={{#property:P345|from={{{qid|}}}}}|sep=,}}/
== Documentation ==
    | find?q={{urlencode:{{PAGENAMEBASE}}}}&s=tt
This template generates a link to a specific IMDb page for a movie or TV show.
    }}
 
  }}{{#switch: {{lc:{{{section|}}}}}
=== Usage ===
  | award | awards = awards Awards for
<syntaxhighlight lang="mediawiki">
  | cast = fullcredits Full cast and crew of
{{IMDb|id=IMDB_ID|title=Custom Link Text}}
  }} {{Trim|{{#if: {{{quotes|}}} | "{{If empty|{{{2|}}}|{{{title|}}}|{{PAGENAMEBASE}}}}" | ''{{If empty|{{{2|}}}|{{{title|}}}|{{PAGENAMEBASE}}}}'' }} {{{3|{{{description|}}}}}}}}] at {{#if: {{{link_hide|}}}| IMDb | [[IMDb (identifier)|IMDb]] }}<!--
</syntaxhighlight>
-->{{EditAtWikidata|pid=P345}}<!-- Tracking categories
 
-->{{#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 }}<!--
=== Parameters ===
-->{{#switch: {{#invoke:String2|matchAny|^tt.........|^tt.......|tt|.........|source={{{1|{{{id}}}}}}|plain=false}}<!--
* `id` - The IMDb ID of the movie or TV show (mandatory).
-->| 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''}}<!--
* `title` - The text to display for the link (optional, defaults to "IMDb").
-->| 4 = {{Main other|[[Category:IMDb template with invalid id set]]}}{{Preview warning|IMDb ID should not contain more than eight digits}}<!--
 
-->}}<!--
=== Example ===
-->{{#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]]}} }}<!--
<syntaxhighlight lang="mediawiki">
-->{{#switch: {{Wikidata|property|raw|P31}} <!-- instance of -->
{{IMDb|id=0082010|title=An American Werewolf in London}}
| Q21191270 <!-- television series episode -->
</syntaxhighlight>
| Q21664088 <!-- two-part episode -->
 
| Q50062923 <!-- three-part episode -->
Produces:
| Q50914552 <!-- four-part episode -->
[https://www.imdb.com/title/tt0082010/ An American Werewolf in London]
| Q99079902 <!-- five-part episode -->
 
| Q123186929 <!-- six-part episode -->
=== Notes ===
| Q55422400 <!-- Sarah Jane Smith serial -->
- The `id` parameter must be provided for the link to work.
| Q61220733 = <!-- Star Trek episode --> [[Category:Pages using IMDb title instead of IMDb episode]]{{Preview warning|[[Template:IMDb episode]] should be used for television episodes}}
- If `title` is not specified, the link text defaults to "IMDb."
| Q3464665 = <!-- television series season --> [[Category:Pages using IMDb title instead of IMDb episodes]]{{Preview warning|[[Template:IMDb episodes]] should be used for television seasons}}
- Ensure the IMDb ID is correct, including only the numeric portion (e.g., `0082010`).
| 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}}
 
}}<!--
-->{{#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}} }}<!--
--></includeonly><noinclude>
{{Documentation}}
</noinclude>
</noinclude>
{{no-index-template}}

Latest revision as of 00:21, 7 January 2025


Documentation[edit]

This template generates a link to a specific IMDb page for a movie or TV show.

Usage[edit]

{{IMDb|id=IMDB_ID|title=Custom Link Text}}

Parameters[edit]

  • `id` - The IMDb ID of the movie or TV show (mandatory).
  • `title` - The text to display for the link (optional, defaults to "IMDb").

Example[edit]

{{IMDb|id=0082010|title=An American Werewolf in London}}

Produces: An American Werewolf in London

Notes[edit]

- The `id` parameter must be provided for the link to work. - If `title` is not specified, the link text defaults to "IMDb." - Ensure the IMDb ID is correct, including only the numeric portion (e.g., `0082010`).