Difference between revisions of "Template:IMDb name/testcases"
Jump to navigation
Jump to search
imported>Zyxw m (→Parameter: section: update text) |
imported>Zyxw m (formatting) |
||
| Line 97: | Line 97: | ||
}} | }} | ||
{{Test case nowiki|format=inline|collapsible=yes|title=awards (named parameters for ID and Name) | {{Test case nowiki|format=inline|collapsible=yes|title=awards (named parameters for ID and Name) | ||
| − | |code=<nowiki>{{__TEMPLATENAME__ |id= 0001109 |name= Jaye Davidson | section= awards }}</nowiki> | + | |code=<nowiki>{{__TEMPLATENAME__ | id= 0001109 | name= Jaye Davidson | section= awards }}</nowiki> |
}} | }} | ||
| Line 104: | Line 104: | ||
}} | }} | ||
{{Test case nowiki|format=inline|collapsible=yes|title=award (named parameters for ID and Name) | {{Test case nowiki|format=inline|collapsible=yes|title=award (named parameters for ID and Name) | ||
| − | |code=<nowiki>{{__TEMPLATENAME__ |id= 0001109 |name= Jaye Davidson | section= award }}</nowiki> | + | |code=<nowiki>{{__TEMPLATENAME__ | id= 0001109 | name= Jaye Davidson | section= award }}</nowiki> |
}} | }} | ||
| Line 111: | Line 111: | ||
}} | }} | ||
{{Test case nowiki|format=inline|collapsible=yes|title=bio (named parameters for ID and Name) | {{Test case nowiki|format=inline|collapsible=yes|title=bio (named parameters for ID and Name) | ||
| − | |code=<nowiki>{{__TEMPLATENAME__ |id= 0001109 |name= Jaye Davidson | section= bio }}</nowiki> | + | |code=<nowiki>{{__TEMPLATENAME__ | id= 0001109 | name= Jaye Davidson | section= bio }}</nowiki> |
}} | }} | ||
| Line 118: | Line 118: | ||
}} | }} | ||
{{Test case nowiki|format=inline|collapsible=yes|title=biography (named parameters for ID and Name) | {{Test case nowiki|format=inline|collapsible=yes|title=biography (named parameters for ID and Name) | ||
| − | |code=<nowiki>{{__TEMPLATENAME__ |id= 0001109 |name= Jaye Davidson | section= biography }}</nowiki> | + | |code=<nowiki>{{__TEMPLATENAME__ | id= 0001109 | name= Jaye Davidson | section= biography }}</nowiki> |
}} | }} | ||
| Line 125: | Line 125: | ||
}} | }} | ||
{{Test case nowiki|format=inline|collapsible=yes|title=other (named parameters for ID and Name) | {{Test case nowiki|format=inline|collapsible=yes|title=other (named parameters for ID and Name) | ||
| − | |code=<nowiki>{{__TEMPLATENAME__ |id= 0001109 |name= Jaye Davidson | section= other }}</nowiki> | + | |code=<nowiki>{{__TEMPLATENAME__ | id= 0001109 | name= Jaye Davidson | section= other }}</nowiki> |
}} | }} | ||
Revision as of 19:22, 28 July 2018
| This is the template test cases page for the sandbox of Template:IMDb name. Script error: No such module "Purge". to update the examples. If there are many examples of a complicated template, later ones may break due to limits in MediaWiki, see the HTML comment "NewPP limit report" in the rendered page. You can also use Special:ExpandTemplates to examine the results of template uses. You can test how this page looks in the different skins with these links: |
No parameters
If no ID is provided, the template uses Wikidata property Template:Wpl:
- https://www.imdb.com/name/{{#property:P345}}/
If the page does not have a Wikidata item containing that property, the template uses the page name:
- https://www.imdb.com/Name?{{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 Name (unnamed parameters) |
|---|
|
| empty ID and Name (named parameters) |
|---|
|
Parameter: id (1)
If the ID does not start with "nm", the template adds "nm" (and leading zeros, if needed):
- 0001109 — https://www.imdb.com/name/nm0001109/
- 1109 — https://www.imdb.com/name/nm0001109/
If the ID starts with "nm", the template does not make any changes:
- nm0001109 — https://www.imdb.com/name/nm0001109/ (valid ID)
- nm1109 — https://www.imdb.com/name/nm1109/ (invalid ID)
- An article using
{{IMDb name|nm1109}}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 "nm" and leading zeros (unnamed parameter) |
|---|
|
| ID with "nm" and leading zeros (named parameter) |
|---|
|
| ID with "nm" without leading zeros (unnamed parameter) |
|---|
|
| ID with "nm" without leading zeros (named parameter) |
|---|
|
| ID and empty Name (unnamed parameters) |
|---|
|
| ID and empty Name (named parameters) |
|---|
|
Parameter: name (2)
| ID and Name (unnamed parameters) |
|---|
|
| ID and Name (named parameters) |
|---|
|
Parameter: section
If |section=awards or |section=award:
- "Awards for " is added before the name, inside the link text
- awards is added to the end of the URL: https://www.imdb.com/name/nm#######/awards
If |section=bio or |section=biography:
- "Biography for " is added before the name, inside the link text
- bio is added to the end of the URL: https://www.imdb.com/name/nm#######/bio
Any other values in |section= are ignored.
| awards (unnamed parameters for ID and Name) |
|---|
|
| awards (named parameters for ID and Name) |
|---|
|
| award (unnamed parameters for ID and Name) |
|---|
|
| award (named parameters for ID and Name) |
|---|
|
| bio (unnamed parameters for ID and Name) |
|---|
|
| bio (named parameters for ID and Name) |
|---|
|
| biography (unnamed parameters for ID and Name) |
|---|
|
| biography (named parameters for ID and Name) |
|---|
|
| other (unnamed parameters for ID and Name) |
|---|
|
| other (named parameters for ID and Name) |
|---|
|