Template:Douban/doc: Difference between revisions
→Parameters: The JSON info table well updated base on the current Template data. Tags: Reverted Mobile edit Mobile web edit Advanced mobile edit |
Dabao qian (talk | contribs) |
||
Line 5: | Line 5: | ||
Go to [https://www.douban.com/ Douban.com] ([[Douban]]), search and find the page of the work that you are looking for, check out its URL. |
Go to [https://www.douban.com/ 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 |
'''1. If it is a movie''', then the URL should be like <code><nowiki>https://movie.douban.com/subject/[ID]/</nowiki></code>. In a Wikipedia article you may insert the code below |
||
Or |
|||
<code> |
|||
<nowiki>https://m.douban.com/movie/celebrity/[celebID]/</nowiki></code><br> |
|||
In a Wikipedia article you may insert the code below |
|||
<pre> |
<pre> |
||
{{Douban| |
{{Douban|[ID]}} |
||
{{Douban|celebID=[celebID]}} |
|||
</pre> |
</pre> |
||
For example: |
|||
* <code><nowiki>{{Douban| |
* <code><nowiki>{{Douban|1292052}}</nowiki></code> yields: "{{Douban|1292052}}"<small> (the current Wikipedia article's title will be used as the link's shown text)</small> |
||
Or you can change the Tittle by |
|||
<pre> |
|||
{{Douban|movieID=[movieID]|tittle=[movie tittle]}} |
|||
</pre> |
|||
Which will give you: |
|||
⚫ | |||
⚫ | |||
⚫ | |||
Or |
Or |
||
<pre> |
<pre> |
||
{{Douban| |
{{Douban|[ID]|[Link text]}} |
||
</pre> |
</pre> |
||
⚫ | |||
Which will give you: |
|||
* <code><nowiki>{{Douban| |
* <code><nowiki>{{Douban|1292052|EXAMPLE TEXT}}</nowiki></code> yields: "{{Douban|1292052|EXAMPLE TEXT}}" |
||
'''2. If it is a book or a music''', then the URL should be like <code><nowiki>https:// |
'''2. If it is a book or a music''', then the URL should be like <code><nowiki>https://book.douban.com/subject/[ID]/</nowiki></code><small>(or <code><nowiki>music</nowiki></code> in place of <code><nowiki>book</nowiki></code>)</small>. In a Wikipedia article you may insert the code below |
||
<pre> |
<pre> |
||
{{Douban| |
{{Douban|[ID]|[Link text]|[Type]}}, |
||
</pre |
</pre> |
||
[Type] could be "book" or "music"<br> |
|||
Or |
|||
[Link text] could be omitted, if so, the current Wikipedia article's title will be used<br> |
|||
<pre> |
|||
⚫ | |||
{{Douban|musicID=[musicID]|tittle=[music tittle]}}, |
|||
⚫ | |||
</pre> |
|||
⚫ | |||
⚫ | |||
* <code><nowiki>{{Douban|bookID=1829226|tittle=book tittle}}</nowiki></code> yields: {{Douban|bookID=1829226|tittle=book tittle}} |
|||
For example 2: |
|||
'''3. If it is a page of other type:''' |
|||
* <code><nowiki>{{Douban|musicID=36695456|tittle=music tittle}}</nowiki></code> yields: {{Douban|musicID=36695456|tittle=music tittle}} |
|||
'''type''': Type of the Douban webpage, or the <code>[DIR]</code> in the URL <code><nowiki>https://www.douban.com/[DIR]/[id]/</nowiki></code><br>All possible values:<br> |
|||
* Movie, book or music (all of which have URL like <code><nowiki>https://[TYPE].douban.com/subject/[id]/</nowiki></code>), use 'movie', 'book' or 'music' |
|||
* Page with URL like <code><nowiki>https://www.douban.com/[DIR]/[id]/</nowiki></code>, use <code>[DIR]</code> (\"/\" is allowed)", |
|||
example: movie, game, subject, location/drama, etc. |
|||
== Parameters == |
== Parameters == |
||
Line 49: | Line 43: | ||
"description": "To generate a link to a Douban webpage", |
"description": "To generate a link to a Douban webpage", |
||
"params": { |
"params": { |
||
" |
"id": { |
||
"label": "ID", |
"label": "ID", |
||
"description": "ID is the [ |
"description": "ID, that is the <code>[ID]</code> in the URL <code><nowiki>https://[type/www].douban.com/[dir]/[ID]/</nowiki></code>", |
||
"example": " |
"example": "1292052", |
||
"type": "number", |
"type": "number", |
||
"aliases": [ |
"aliases": [ |
||
" ( |
"1 (or the first anonymous parameter)" |
||
], |
], |
||
"required": true |
"required": true |
||
}, |
}, |
||
" |
"title": { |
||
"label": "Link |
"label": "Link text", |
||
"description": "Text that is shown by the link", |
"description": "Text that is shown by the link", |
||
"example": "The Shawshank Redemption", |
"example": "The Shawshank Redemption", |
||
"type": "string", |
"type": "string", |
||
"default": "The current Wikipedia article (or page of other type)'s |
"default": "The current Wikipedia article (or page of other type)'s title", |
||
"aliases": [ |
|||
"2 (or the second anonymous parameter)" |
|||
] |
|||
}, |
|||
"type": { |
|||
"label": "Type", |
|||
"description": "Type of the Douban webpage (see above)", |
|||
"example": "\"movie\", \"game\", \"subject\", \"location/drama\", etc.", |
|||
"type": "string", |
|||
"default": "movie", |
|||
"aliases": [ |
"aliases": [ |
||
"3 (or the third anonymous parameter)" |
|||
"(can be the topic, page-tittle or your preferred tittle of the link-text or page)" |
|||
] |
] |
||
} |
} |
||
}, |
|||
}, |
|||
"paramOrder": [ |
"paramOrder": [ |
||
" |
"id", |
||
" |
"title", |
||
"type" |
|||
] |
] |
||
} |
} |
Revision as of 18:43, 7 April 2024
This is a documentation subpage for Template:Douban. It may contain usage information, categories and other content that is not part of the original template page. |
- Douban film ID (P4529) (see uses)
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/doc 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/doc 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 |