小 (分类) |
小无编辑摘要 |
||
第32行: | 第32行: | ||
{{#if:{{{playlist|}}}|1|0}}+ | {{#if:{{{playlist|}}}|1|0}}+ | ||
{{#if:{{{p|}}}|1|0}}+ | {{#if:{{{p|}}}|1|0}}+ | ||
{{#if:{{{video|}}}|1|0}}+ | |||
{{#if:{{{v|}}}|1|0}}+ | |||
{{#if:{{{id|}}}|1|0}}+ | {{#if:{{{id|}}}|1|0}}+ | ||
{{#if:{{{2|}}}|1|0}}+ | {{#if:{{{2|}}}|1|0}}+ |
2020年7月5日 (日) 17:24的版本
视频 在 YouTube
请看:wikipedia:Template:YouTube。
This template is used to create an external link to YouTube in the ==External links== section. It may also be used for other YouTube links such as those in {{External media}}
.
This is not a citation template. Use {{cite AV media}}
to provide bibliographic citations in footnotes. Alternatively, use {{cite news}}
if the video is a newscast, or {{cite episode}}
if the video is in an episodic format.
Usage and examples
Video
Template:Wikidata property Usage (one parameter):
{{YouTube|VIDEOID}}
{{YouTube|id=VIDEOID}}
Usage (two parameters):
{{YouTube|VIDEOID|TITLE}}
{{YouTube|id=VIDEOID|title=TITLE}}
Parameter descriptions:
- id (or unnamed parameter 1) is the "YouTube video id" which appears as:
- https://www.youtube.com/watch?v=Template:Hilite
- title (or unnamed parameter 2) gives an optional description that may replace the default title (Video)
Examples (1 parameter):
Examples (2 parameters):
* {{YouTube|9bZkp7q19f0|"Gangnam Style"}}
- Template:Delink 在 YouTube
* {{YouTube|id=9bZkp7q19f0|title="Gangnam Style"}}
- Template:Delink 在 YouTube
With timestamp
Usage:
{{YouTube|id=VIDEOID|time=TIMESTAMP}}
{{YouTube|id=VIDEOID|t=TIMESTAMP}}
Parameter descriptions:
- time or t is the timestamp within the video for the link target.
Examples:
{{YouTube|id=9bZkp7q19f0|time=3m2s}}
{{YouTube|id=9bZkp7q19f0|time=122}}
{{YouTube|id=9bZkp7q19f0|t=3m2s}}
User's channel
Usage (one parameter):
{{YouTube|u=USERNAME}}
{{YouTube|user=USERNAME}}
Usage (two parameters):
{{YouTube|u=USERNAME|TITLE}}
{{YouTube|u=USERNAME|title=TITLE}}
{{YouTube|user=USERNAME|TITLE}}
{{YouTube|user=USERNAME|title=TITLE}}
Parameter descriptions:
- u or user is the "YouTube user's (channel) name" which appears as:
- https://www.youtube.com/user/Template:Hilite
- title gives an optional description that may replace the default title (PAGENAME)
- suffix replaces the default " 's " after the channel name. It is only to be used in the rare occasion that the channel name is a compound noun ending in S, and making it possessive does not repeat the S sound. Do not use it for a brand name ending in S, for example Smosh Games, which is a singular entity. See MOS:POSS for more information.
Examples (1 parameter):
* {{YouTube|u=pewdiepie}}
- Template:Delink's 频道 在 YouTube
* {{YouTube|user=pewdiepie}}
- Template:Delink's 频道 在 YouTube
Example (2 parameters):
* {{YouTube|u=pewdiepie|PewDiePie}}
- Template:Delink's 频道 在 YouTube
* {{YouTube|user=pewdiepie|title=PewDiePie}}
- Template:Delink's 频道 在 YouTube
Example (3 parameters):
* {{YouTube|user=officialBEG|title=Brown Eyed Girls|suffix='}}
- Template:Delink' 频道 在 YouTube
Channel
Template:Wikidata property Usage (one parameter):
{{YouTube|c=CHANNELID}}
{{YouTube|channel=CHANNELID}}
Usage (two parameters):
{{YouTube|c=CHANNELID|TITLE}}
{{YouTube|c=CHANNELID|title=TITLE}}
{{YouTube|channel=CHANNELID|TITLE}}
{{YouTube|channel=CHANNELID|title=TITLE}}
Parameter descriptions:
- c or channel is the "YouTube channel id" which appears as:
- https://www.youtube.com/channel/Template:Hilite
- title gives an optional description that may replace the default title (PAGENAME)
Examples (1 parameter):
* {{YouTube|c=UC-9-kyTW8ZkZNDHQJ6FgpwQ}}
- Template:Delink's 频道 在 YouTube
* {{YouTube|channel=UC-9-kyTW8ZkZNDHQJ6FgpwQ}}
- Template:Delink's 频道 在 YouTube
Example (2 parameters):
* {{YouTube|c=UC-9-kyTW8ZkZNDHQJ6FgpwQ|#Music}}
- Template:Delink's 频道 在 YouTube
* {{YouTube|channel=UC-9-kyTW8ZkZNDHQJ6FgpwQ|title=#Music}}
- Template:Delink's 频道 在 YouTube
Show
Usage (one parameter):
{{YouTube|s=SHOWNAME}}
{{YouTube|show=SHOWNAME}}
Usage (two parameters):
{{YouTube|s=SHOWNAME|TITLE}}
{{YouTube|s=SHOWNAME|title=TITLE}}
{{YouTube|show=SHOWNAME|TITLE}}
{{YouTube|show=SHOWNAME|title=TITLE}}
Parameter descriptions:
- s or show is the "YouTube show name" which appears as:
- https://www.youtube.com/show/Template:Hilite
- title gives an optional description that may replace the default title (PAGENAME)
Examples (1 parameter):
* {{YouTube|s=startrek}}
- Template:Delink 节目 在 YouTube
* {{YouTube|show=startrek}}
- Template:Delink 节目 在 YouTube
Example (2 parameters):
* {{YouTube|s=startrek|Star Trek: The Original Series}}
- Template:Delink 节目 在 YouTube
* {{YouTube|show=startrek|title=Star Trek: The Original Series}}
- Template:Delink 节目 在 YouTube
Playlist
Template:Wikidata property Usage (one parameter):
{{YouTube|p=PLAYLISTID}}
{{YouTube|playlist=PLAYLISTID}}
Usage (two parameters):
{{YouTube|p=PLAYLISTID|TITLE}}
{{YouTube|p=PLAYLISTID|title=TITLE}}
{{YouTube|playlist=PLAYLISTID|TITLE}}
{{YouTube|playlist=PLAYLISTID|title=TITLE}}
Parameter descriptions:
- p or playlist is the "YouTube playlist id" which appears as:
- https://www.youtube.com/playlist?list=Template:Hilite
- title gives an optional description that may replace the default title (PAGENAME)
Examples (1 parameter):
* {{YouTube|p=PLrEnWoR732-DZV1Jc8bUpVTF_HTPbywpE}}
- Template:Delink 播放列表 在 YouTube
* {{YouTube|playlist=PLrEnWoR732-DZV1Jc8bUpVTF_HTPbywpE}}
- Template:Delink 播放列表 在 YouTube
Example (2 parameters):
* {{YouTube|p=PLrEnWoR732-DZV1Jc8bUpVTF_HTPbywpE|Learn Something New}}
- Template:Delink 播放列表 在 YouTube
* {{YouTube|playlist=PLrEnWoR732-DZV1Jc8bUpVTF_HTPbywpE|title=Learn Something New}}
- Template:Delink 播放列表 在 YouTube
Suppress wikilink
The link to YouTube can be suppressed with the parameter |link=no
. Example:
* {{YouTube|9bZkp7q19f0|"PSY - GANGNAM STYLE(강남스타일) M/V"|link=no}}
- Template:Delink 在 YouTube
No ID in template
The template will display an error message if no parameters are provided.
It will display an error message if the parameter provided is not known.
==TemplateData== {{TemplateData header}} <templatedata> { "description": "Use this to create an external link to YouTube in the External links section. This is not a citation template.", "params": { "id": { "label": "YouTube video id", "description": "The video id which appears after https://www.youtube.com/watch?v= in the URL", "aliases": [ "1" ], "example": "9bZkp7q19f0", "type": "string", "required": true, "suggested": true }, "user": { "label": "YouTube user's (channel) name", "description": "The user name which appears after https://www.youtube.com/user/ in the URL", "aliases": [ "u" ], "example": "pewdiepie", "type": "string" }, "channel": { "label": "YouTube channel id", "description": "The channel id which appears after https://www.youtube.com/channel/ in the URL", "aliases": [ "c" ], "example": "UC-9-kyTW8ZkZNDHQJ6FgpwQ", "type": "string" }, "show": { "label": "YouTube show name", "description": "The show name which appears after https://www.youtube.com/show/ in the URL", "aliases": [ "s" ], "example": "startrek", "type": "string" }, "playlist": { "label": "YouTube playlist id", "description": "The playlist id which appears after https://www.youtube.com/playlist?list= in the URL", "aliases": [ "p" ], "example": "PLrEnWoR732-DZV1Jc8bUpVTF_HTPbywpE", "type": "string" }, "title": { "label": "Title", "description": "The name of the page being linked to", "suggested": true, "aliases": [ "1", "2" ], "example": "Gangnam Style", "default": "If it is a video, Video, if it is a show, the article's page name in italics, otherwise, the article's page name unformatted", "type": "string" }, "suffix": { "label": "Channel title suffix", "description": "Text immediately after the channel title. It is only to be used in the rare occasion that the channel title is a compound noun ending in S, and making it possessive does not repeat the S sound.", "example": "'", "default": "'s", "type": "string" }, "link": { "label": "Link on", "description": "Set this parameter to no to suppress the link to the YouTube article", "example": "no", "type": "string" }, "time": { "aliases": [ "t" ], "label": "Timestamp", "description": "The timestamp within the video for the link target; usually appears after &t= in the full URL or ?t= in a shortened URL", "example": "3m2s", "type": "string" } }, "paramOrder": [ "id", "time", "user", "channel", "show", "playlist", "title", "suffix", "link" ], "format": "inline" }</templatedata> == Tracking categories == * {{clc|Articles using YouTube with invalid parameters}} – list of pages using this template with too many parameters, or with invalid text in the {{para|title}} parameter. * {{clc|Pages using YouTube with unknown parameters}} – list of pages using this template with unsupported parameters == See also == * {{Tl|External media}} – to link to external media, including YouTube videos * {{Tl|Cite AV media}} – to cite a video * {{Tl|Cite news}} – to cite a newscast * {{Tl|Cite episode}} – to cite an episode of a show * {{Tl|Cite serial}} – to cite a serial of a show * {{Tl|YouTube navbox}} – navigation box for YouTube related articles * [[WP:YOUTUBE]] – YouTube linking guideline * [[Wikipedia:WikiProject Internet culture]] – Wikiproject covering YouTube personalities and videos * All Wikipedia pages linked <span class="plainlinks">[https://en.wikipedia.org/w/index.php?title=Special:LinkSearch&target=http%3A%2F%2F*.youtube.com&limit=500&offset=0 to http://*.youtube.com] and [https://en.wikipedia.org/w/index.php?title=Special%3ALinkSearch&target=https%3A%2F%2F*.youtube.com to https://*.youtube.com]</span> * <span class="plainlinks">[https://en.wikipedia.org/w/index.php?search=insource%3A%2F%3E%5C%7B%5C%7BYouTube%2Fi Search for Wikipedia articles using this template as a reference]</span> <includeonly>{{Basepage subpage| <!-- ADD CATEGORIES BELOW THIS LINE --> [[Category:Google 模板]] [[Category:社交媒体外链模板]] [[Category:电视外链模板]] [[Category:添加跟踪分类的模板]] }}</includeonly>