開啟主選單

求真百科

變更

Template:YouTube/doc

增加 5,341 位元組, 6 年前
模版数据: 翻譯
{{For|导航模板|Template:YouTube navbox}}
{{Documentation subpage}}
{{noteTA
|G1=IT
}}
<!-- 请在此页面的底部添加分类 -->
{{Ombox
| type = content
| textstyle = font-size: 110%;
| text = '''请不要使用此模板链接到违反[[WP:外部链接|版权法]]的材料。'''<br />如果链接这种材料,则必须使用合乎版权的链接替代或者<u>立即删除</u>。
}}
{{high-use|6,000+}}
本模板用作產生引用[[YouTube]]-{zh-tw:影片;zh-cn:视频;zh-hk:影片}-的參考文字。

== 用法 ==
-{}-{{tlBh}}YouTube|'''视频id'''|'''link=no'''|'''视频描述'''|h='''小時數'''|m='''分鐘數'''|s='''秒數'''|language='''語言'''{{tlBf}}

*參數說明:
**參數'''1''':视频id,即是在“<nowiki>http://www.youtube.com/watch?v=</nowiki>”之后的YouTube id
***例如:https://www.youtube.com/watch?v=7bvukR-332A ,那麼视频id便是「7bvukR-332A」。
**參數'''2'''(可省略):為视频给出了一个可选的描述。
***若省略此參數則描述會是包含本模板的頁面名稱。
**'''h'''(可省略):视频要開始播放的小時數。若省略此參數則為0。
**'''m'''(可省略):视频要開始播放的分鐘數。若省略此參數則為0。
**'''s'''(可省略):视频要開始播放的秒數。若省略此參數則為0。(注意:参数show不可用简称s,否则会与秒數冲突而无法正常显示。)
**'''language'''(可省略):视频的語言。
**'''link=no'''(可省略):用于取消YouTube条目链接。

==範例==
#<code><nowiki>{{Youtube|PfcgWfKOp1g}}</nowiki></code>
#*效果:{{Youtube|PfcgWfKOp1g}}
#<code><nowiki>{{YouTube|9bZkp7q19f0|《江南Style》}}</nowiki></code>
#*效果:{{YouTube|9bZkp7q19f0|《江南Style》}}
#<code><nowiki>{{YouTube|u=pewdiepie}}</nowiki></code>
#*效果:{{YouTube|u=pewdiepie|PewDiePie}}
#<code><nowiki>{{YouTube|show=startrek|''Star Trek: The Original Series''}}</nowiki></code>
#*效果:{{YouTube|show=startrek|''Star Trek: The Original Series''}}
#<code><nowiki>{{Youtube|PfcgWfKOp1g|Varias.Macau 85/86|m=3}}</nowiki></code>
#*效果:{{Youtube|PfcgWfKOp1g|Varias.Macau 85/86|m=3}}
#<code><nowiki>{{Youtube|PfcgWfKOp1g|Varias.Macau 85/86|m=3|s=04}}</nowiki></code>
#*效果:{{Youtube|PfcgWfKOp1g|Varias.Macau 85/86|m=3|s=04}}
#<code><nowiki>{{Youtube|PfcgWfKOp1g|Varias.Macau 85/86|m=3|s=04|language=zh-hk}}</nowiki></code>
#*效果:{{Youtube|PfcgWfKOp1g|Varias.Macau 85/86|m=3|s=04|language=zh-hk}}

== 用户频道链接 ==
<code><nowiki>{{YouTube|</nowiki>user=''userchannelname''|''title''<nowiki>}}</nowiki></code>
* ''user'' 是“YouTube 用户频道名”,像是<font color="darkblue"><nowiki>https://www.youtube.com/user/</nowiki>''userchannelname''</font>
* ''user'' 参数也可以使用简写 ''u'' 指定
<code><nowiki>{{YouTube|</nowiki>channel=''userchannelid''|''title''<nowiki>}}</nowiki></code>
* ''channel'' 是“YouTube 用户频道id”,像是<font color="darkblue"><nowiki>https://www.youtube.com/channel/</nowiki>''userchannelid''</font>
* ''title'' 是可选的描述,如不提供则为页面标题名(PAGENAME)

==模版数据==
{{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 影片ID",
"description": "影片ID是網址 https://www.youtube.com/watch?v=[影片ID] 之處",
"aliases": [
"1"
],
"example": "9bZkp7q19f0",
"type": "string"
},
"user": {
"label": "YouTube 使用者名稱",
"description": "YouTube 使用者名稱是在網址 https://www.youtube.com/user/[使用者名稱] 之處",
"aliases": [
"u"
],
"example": "pewdiepie",
"type": "string"
},
"channel": {
"label": "YouTube 頻道ID",
"description": "YouTube 頻道ID是在網址 https://www.youtube.com/channel/[頻道ID] 之處",
"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",
"example": "startrek",
"type": "string"
},
"playlist": {
"label": "YouTube 播放清單ID",
"description": "YouTube 播放清單ID是在網址 https://www.youtube.com/playlist?list=[播放清單ID] 之處",
"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"
},
"link": {
"label": "Link on",
"description": "Set this parameter to no to suppress the link to the YouTube article",
"example": "no",
"type": "string"
}
}
}
</templatedata>

== 參見 ==
* [[Template:Cite video]]
* [[Template:Youku]]
* [[Template:土豆網]]

<includeonly>{{Basepage subpage|
<!-- ADD CATEGORIES BELOW THIS LINE -->
[[Category:Google模板]]
[[Category:社交网络链接模板]]
[[Category:電視外部資源模板]]
}}</includeonly>