Template:Douban: Difference between revisions
Dabao qian (talk | contribs) update via zhwiki |
Dabao qian (talk | contribs) endif |
||
Line 2: | Line 2: | ||
-->{{#switch:{{{3|{{{type|movie}}}}}}<!-- the parameter "type" is "movie" by default --> |
-->{{#switch:{{{3|{{{type|movie}}}}}}<!-- the parameter "type" is "movie" by default --> |
||
|movie=movie.douban.com/subject/{{{1|{{{id|{{#if:{{#property:P4529}}|{{#property:P4529}}}}}}}}}} |
|movie=movie.douban.com/subject/{{{1|{{{id|{{#if:{{#property:P4529}}|{{#property:P4529}}}}}}}}}} |
||
|book=book.douban.com/subject/{{{1|{{{id|{{#if:{{#property:P6442}}|{{#property:P6442}}}}}}}} |
|book=book.douban.com/subject/{{{1|{{{id|{{#if:{{#property:P6442}}|{{#property:P6442}}}}}}}}}} |
||
|music=music.douban.com/subject/{{{1|{{{id|{{#if:{{#property:P6445}}|{{#property:P6445}}}}}}}} |
|music=music.douban.com/subject/{{{1|{{{id|{{#if:{{#property:P6445}}|{{#property:P6445}}}}}}}}}} |
||
|www.douban.com/{{{3|{{{type|}}}}}}/{{{1|{{{id|}}}}}}<!-- default --> |
|www.douban.com/{{{3|{{{type|}}}}}}/{{{1|{{{id|}}}}}}<!-- default --> |
||
}}/<!-- |
}}/<!-- |
Revision as of 18:45, 11 April 2024
![](http://upload.wikimedia.org/wikipedia/commons/thumb/f/ff/Wikidata-logo.svg/40px-Wikidata-logo.svg.png)
Template:Douban displays an external link to a page for a title (movies, TV series, games, etc.) at the Douban website. It is intended for use in the external links section of an article.
For an external link to a person, use {{Douban people}} instead.
Usage
Go to Douban.com (Douban), search and find the page of the work that you are looking for, check out its URL.
1. If it is a movie, then the URL should be like https://movie.douban.com/subject/[ID]/
. In a Wikipedia article you may insert the code below
{{Douban|[ID]}}
For example:
{{Douban|1292052}}
yields: "Douban at Douban (in Chinese)" (the current Wikipedia article's title will be used as the link's shown text)
Or
{{Douban|[ID]|[Link text]}}
For example:
{{Douban|1292052|EXAMPLE TEXT}}
yields: "EXAMPLE TEXT at Douban (in Chinese)"
2. If it is a book or a music, then the URL should be like https://book.douban.com/subject/[ID]/
(or music
in place of book
). In a Wikipedia article you may insert the code below
{{Douban|[ID]|[Link text]|[Type]}},
[Type] could be "book" or "music"
[Link text] could be omitted, if so, the current Wikipedia article's title will be used
For example:
{{Douban|1829226|EXAMPLE TEXT|book}}
yields: "EXAMPLE TEXT at Douban (in Chinese)"{{Douban|1829226||book}}
yields: "Douban at Douban (in Chinese)" (the current Wikipedia article's title will be used as the link's shown text)
3. If it is a page of other type:
type: Type of the Douban webpage, or the [DIR]
in the URL https://www.douban.com/[DIR]/[id]/
All possible values:
- Movie, book or music (all of which have URL like
https://[TYPE].douban.com/subject/[id]/
), use 'movie', 'book' or 'music' - Page with URL like
https://www.douban.com/[DIR]/[id]/
, use[DIR]
(\"/\" is allowed)",
example: movie, game, subject, location/drama, etc.
Parameters
To generate a link to a Douban webpage
Parameter | Description | Type | Status | |
---|---|---|---|---|
ID | id 1 (or the first anonymous parameter) | ID, that is the <code>[ID]</code> in the URL <code><nowiki>https://[type/www].douban.com/[dir]/[ID]/</nowiki></code>
| Number | required |
Link text | title 2 (or the second anonymous parameter) | Text that is shown by the link
| String | optional |
Type | type 3 (or the third anonymous parameter) | Type of the Douban webpage (see above)
| String | optional |
See also
- {{Douban people}}
- {{IMDb title}}