Difference between revisions of "Template:IMDb title/testcases"
imported>Zyxw m (fix link) |
imported>Zyxw (add tests for unnamed parameter 3) |
||
| Line 91: | Line 91: | ||
Any text in {{para|description}} is added after the title, inside the [[link text]]. | Any text in {{para|description}} is added after the title, inside the [[link text]]. | ||
| − | {{Test case nowiki|format=inline|collapsible=yes|title= | + | {{Test case nowiki|format=inline|collapsible=yes|title=ID, Title, Description (unnamed parameters) |
| − | |code=<nowiki>{{__TEMPLATENAME__ | 0111282 | Stargate | | + | |code=<nowiki>{{__TEMPLATENAME__ | 0111282 | Stargate | (1994 film) }}</nowiki> |
}} | }} | ||
| − | {{Test case nowiki|format=inline|collapsible=yes|title= | + | {{Test case nowiki|format=inline|collapsible=yes|title=ID, Title, Description (named parameters) |
|code=<nowiki>{{__TEMPLATENAME__ | id= 0111282 | title= Stargate | description= (1994 film) }}</nowiki> | |code=<nowiki>{{__TEMPLATENAME__ | id= 0111282 | title= Stargate | description= (1994 film) }}</nowiki> | ||
}} | }} | ||
| Line 146: | Line 146: | ||
== All parameters == | == All parameters == | ||
| − | {{Test case nowiki|format=inline|collapsible=yes|title= | + | {{Test case nowiki|format=inline|collapsible=yes|title=All parameters (unnamed parameters for ID, Title, Description) |
| − | |code=<nowiki>{{__TEMPLATENAME__ | 0111282 | Stargate | | + | |code=<nowiki>{{__TEMPLATENAME__|0111282|Stargate|(1994 film)|quotes=y|section=awards}}</nowiki> |
}} | }} | ||
| − | {{Test case nowiki|format=inline|collapsible=yes|title= | + | {{Test case nowiki|format=inline|collapsible=yes|title=All parameters (named parameters for ID, Title, Description) |
| − | |code=<nowiki>{{__TEMPLATENAME__ | id= 0111282 | title= Stargate | description= (1994 film) | section= awards }}</nowiki> | + | |code=<nowiki>{{__TEMPLATENAME__|id=0111282|title=Stargate|description=(1994 film)|quotes=y|section=awards}}</nowiki> |
}} | }} | ||
Revision as of 20:01, 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.
| ID, Title, Description (unnamed parameters) |
|---|
|
| ID, Title, Description (named 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) |
|---|
|