Difference between revisions of "Template:IMDb title/testcases"
imported>Zyxw (add tests for "quotes" parameter) |
imported>Zyxw (sort sections) |
||
| Line 77: | Line 77: | ||
By default, the title is displayed in [[italic type]]: | By default, the title is displayed in [[italic type]]: | ||
| − | : see {{Section link||Parameter: | + | : see {{Section link||Parameter: description}} for non-italic text placed after the title |
| − | : see {{Section link||Parameter: | + | : see {{Section link||Parameter: quotes}} for the title in [[quotation mark]]s, instead of italics |
{{Test case nowiki|format=inline|collapsible=yes|title=ID and Title (unnamed parameters) | {{Test case nowiki|format=inline|collapsible=yes|title=ID and Title (unnamed parameters) | ||
| Line 85: | Line 85: | ||
{{Test case nowiki|format=inline|collapsible=yes|title=ID and Title (named parameters) | {{Test case nowiki|format=inline|collapsible=yes|title=ID and Title (named parameters) | ||
|code=<nowiki>{{__TEMPLATENAME__ | id= 0111282 | title= Stargate }}</nowiki> | |code=<nowiki>{{__TEMPLATENAME__ | id= 0111282 | title= Stargate }}</nowiki> | ||
| + | }} | ||
| + | |||
| + | == Parameter: description (3) == | ||
| + | |||
| + | Any text in {{para|description}} is added after the title, inside the [[link text]]. | ||
| + | |||
| + | {{Test case nowiki|format=inline|collapsible=yes|title=description (unnamed parameters for ID and Title) | ||
| + | |code=<nowiki>{{__TEMPLATENAME__ | 0111282 | Stargate | description= (1994 film) }}</nowiki> | ||
| + | }} | ||
| + | {{Test case nowiki|format=inline|collapsible=yes|title=description (named parameters for ID and Title) | ||
| + | |code=<nowiki>{{__TEMPLATENAME__ | id= 0111282 | title= Stargate | description= (1994 film) }}</nowiki> | ||
}} | }} | ||
| Line 103: | Line 114: | ||
{{Test case nowiki|format=inline|collapsible=yes|title=quotes (named ID and Title parameters) | {{Test case nowiki|format=inline|collapsible=yes|title=quotes (named ID and Title parameters) | ||
|code=<nowiki>{{__TEMPLATENAME__ | id= 0111282 | title= Stargate | quotes= 0 }}</nowiki> | |code=<nowiki>{{__TEMPLATENAME__ | id= 0111282 | title= Stargate | quotes= 0 }}</nowiki> | ||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
}} | }} | ||
Revision as of 19:53, 28 July 2018
- 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.
Contents
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 |
|---|
|
| empty ID (unnamed parameter) |
|---|
|
| empty ID (named parameter) |
|---|
|
| empty ID and Title (unnamed parameters) |
|---|
|
| empty ID and Title (named parameters) |
|---|
|
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) |
|---|
|
| ID with "tt" and leading zeros (named parameter) |
|---|
|
| ID with "tt" without leading zeros (unnamed parameter) |
|---|
|
| ID with "tt" without leading zeros (named parameter) |
|---|
|
| 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.
| description (unnamed parameters for ID and Title) |
|---|
|
| description (named parameters for ID and Title) |
|---|
|
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
| description and awards (unnamed parameters for ID and Title) |
|---|
|
| description and awards (named parameters for ID and Title) |
|---|
|