Template:IMDb title/testcases

From blackwiki
< Template:IMDb title
Revision as of 20:07, 28 July 2018 by imported>Zyxw (→‎Parameter: description (3): add tests for empty values)
Jump to navigation Jump to search
  1. REDIRECT Template:Testcases notice
  • From a page move: This is a redirect from a page that has been moved (renamed). This page was kept as a redirect to avoid breaking links, both internal and external, that may have been made to the old page name.

No parameters

If no ID is provided, the template uses Wikidata property Template:Wpl:

https://www.imdb.com/title/{{#property:P345}}/

If the page does not have a Wikidata item containing that property, the template uses the page name:

https://www.imdb.com/Title?{{urlencode:{{PAGENAME}}}}/
The template also adds Category:IMDb template with no id set if the page is located in the main or article namespace.

The link text should be the Wikipedia page name, without disambiguation (via {{PAGENAMEBASE}}).

No parameters
  • {{IMDb title}}Template:PAGENAMEBASE at IMDbScript error: No such module "EditAtWikidata".Expression error: Unrecognized punctuation character "[".
  • {{IMDb title/sandbox}}Template:PAGENAMEBASE at IMDbScript error: No such module "EditAtWikidata".Expression error: Unrecognized punctuation character "[".
empty ID (unnamed parameter)
  • {{IMDb title | }}Template:PAGENAMEBASE at IMDbScript error: No such module "EditAtWikidata".Expression error: Unrecognized punctuation character "[".
  • {{IMDb title/sandbox | }}Template:PAGENAMEBASE at IMDbScript error: No such module "EditAtWikidata".Expression error: Unrecognized punctuation character "[".
empty ID (named parameter)
  • {{IMDb title | id= }}Template:PAGENAMEBASE at IMDbScript error: No such module "EditAtWikidata".Expression error: Unrecognized punctuation character "[".
  • {{IMDb title/sandbox | id= }}Template:PAGENAMEBASE at IMDbScript error: No such module "EditAtWikidata".Expression error: Unrecognized punctuation character "[".
empty ID and Title (unnamed parameters)
  • {{IMDb title | | }}Template:PAGENAMEBASE at IMDbScript error: No such module "EditAtWikidata".Expression error: Unrecognized punctuation character "[".
  • {{IMDb title/sandbox | | }}Template:PAGENAMEBASE at IMDbScript error: No such module "EditAtWikidata".Expression error: Unrecognized punctuation character "[".
empty ID and Title (named parameters)
  • {{IMDb title | id= | title= }}Template:PAGENAMEBASE at IMDbScript error: No such module "EditAtWikidata".Expression error: Unrecognized punctuation character "[".
  • {{IMDb title/sandbox | id= | title= }}Template:PAGENAMEBASE at IMDbScript error: No such module "EditAtWikidata".Expression error: Unrecognized punctuation character "[".

Parameter: id (1)

If the ID does not start with "tt", the template adds "tt" (and leading zeros, if needed):

0111282 — https://www.imdb.com/title/tt0111282/
111282 — https://www.imdb.com/title/tt0111282/

If the ID starts with "tt", the template does not make any changes:

tt0111282 — https://www.imdb.com/title/tt0111282/ (valid ID)
tt111282 — https://www.imdb.com/title/tt111282/ (invalid ID)
An article using {{IMDb title|tt111282}} would be added to Category:IMDb template with invalid id set

The link text should be the Wikipedia page name, without disambiguation (via {{PAGENAMEBASE}}).

ID number with leading zeros (unnamed parameter)
ID number with leading zeros (named parameter)
ID number without leading zeros (unnamed parameter)
ID number without leading zeros (named parameter)
ID with "tt" and leading zeros (unnamed parameter)
  • {{IMDb title | tt0111282 }}Template:PAGENAMEBASE at IMDbScript error: No such module "EditAtWikidata".Expression error: Unrecognized punctuation character "[".
  • {{IMDb title/sandbox | tt0111282 }}Template:PAGENAMEBASE at IMDbScript error: No such module "EditAtWikidata".Expression error: Unrecognized punctuation character "[".
ID with "tt" and leading zeros (named parameter)
  • {{IMDb title | id= tt0111282 }}Template:PAGENAMEBASE at IMDbScript error: No such module "EditAtWikidata".Expression error: Unrecognized punctuation character "[".
  • {{IMDb title/sandbox | id= tt0111282 }}Template:PAGENAMEBASE at IMDbScript error: No such module "EditAtWikidata".Expression error: Unrecognized punctuation character "[".
ID with "tt" without leading zeros (unnamed parameter)
  • {{IMDb title | tt111282 }}Template:PAGENAMEBASE at IMDbScript error: No such module "EditAtWikidata".Expression error: Unrecognized punctuation character "[".
  • {{IMDb title/sandbox | tt111282 }}Template:PAGENAMEBASE at IMDbScript error: No such module "EditAtWikidata".Expression error: Unrecognized punctuation character "[".
ID with "tt" without leading zeros (named parameter)
  • {{IMDb title | id= tt111282 }}Template:PAGENAMEBASE at IMDbScript error: No such module "EditAtWikidata".Expression error: Unrecognized punctuation character "[".
  • {{IMDb title/sandbox | id= tt111282 }}Template:PAGENAMEBASE at IMDbScript error: No such module "EditAtWikidata".Expression error: Unrecognized punctuation character "[".
ID and empty Title (unnamed parameters)
ID and empty Title (named parameters)

Parameter: title (2)

By default, the title is displayed in italic type:

see Script error: No such module "Section link". for non-italic text placed after the title
see Script error: No such module "Section link". for the title in quotation marks, instead of italics
ID and Title (unnamed parameters)
ID and Title (named parameters)

Parameter: description (3)

Any text in |description= is added after the title, inside the link text.

ID, Title, Description (unnamed parameters)
ID, Title, Description (named parameters)
ID and Title, empty Description (unnamed parameters)
ID and Title, empty Description (unnamed parameters)

Parameter: quotes

Any value assigned to |quotes= will place the title in quotes, instead of italics.

quotes (unnamed ID parameter, no Title parameters)
quotes (named ID parameter, no Title parameters)
quotes (unnamed ID and Title parameters)
quotes (named ID and Title parameters)

Parameter: section

If |section=awards or |section=award:

"Awards for " is added before the title, inside the link text
awards is added to the end of the URL: https://www.imdb.com/title/tt#######/awards

Any other values in |section= are ignored.

awards (unnamed parameters for ID and Title)
awards (named parameters for ID and Title)
award (unnamed parameters for ID and Title)
award (named parameters for ID and Title)
other (unnamed parameters for ID and Title)
other (named parameters for ID and Title)

All parameters

All parameters (unnamed parameters for ID, Title, Description)
All parameters (named parameters for ID, Title, Description)