ATTENTION: An Animal Crossing Wiki from Miraheze will be at a new website at animalcrossing.indyamos.com. This will be an enhanced version of this wiki. Please view Special:Diff/57616 for more information.

Template:Youtube: Difference between revisions

From Animal Crossing Wiki
Jump to navigationJump to search
No edit summary
No edit summary
Tag: Manual revert
Line 1: Line 1:
<noinclude> This template is a convenient way to embed YouTube videos on the page.
<includeonly><div class="thumbinner" style="float: {{#switch:{{{3|left}}}|right = right|center = center|#default = left}}; height: {{{height|200px}}}; width: {{{width|250px}}}; margin: 5px;">
 
{{#if:{{{file|}}}|[[File:{{{file|}}}|{{#if:{{{2|}}}|{{{2}}}|250}}px|]]|{{#ev:youtube|{{{1|kEJXS0MiKOA}}}|{{#if:{{{2|}}}|{{{2}}}|250}}}}}}{{#switch:{{{3|}}}
;Use
  |{{Void}}|left|right|center = {{{4|}}} <!-- If {3} = Location, return the caption {4} -->
 
  |#default                  = {{{3|}}} <!-- Else, return the caption {3} -->
  <nowiki>{{youtube|youtube video id|Descriptive text}}</nowiki>
  }}
 
</div></includeonly><noinclude>{{Documentation}}[[Category:Templates]]</noinclude>
  <nowiki>{{youtube|video=youtube video id or video URL|text=Descriptive text}}</nowiki>
 
; Parameters
 
If no parameter name is specified, the first unnamed parameter will be the video ID on YouTube. The second is optional and will be a description that will be shown below the video.
 
Keep in mind that if you put the URL of the video '''you must''' use names in the parameters, because the URL includes the "=" sign and makes it confused with the name of a parameter.
 
If named parameters are specified, they can be:
 
* video: YouTube URL or video ID.
* text (optional): description that will be displayed below the video.
* width (optional): width in pixels of the video.
* height (optional): height in pixels of the video.
* thumb (optional): specify ''right'' or ''left'' so that it is aligned to the right or left.
 
; youtube video id
 
The video ID is a code made up exclusively of letters and numbers and is part of the video URL.
 
Below are examples of YouTube URLs and the video ID in bold:
 
* <nowiki>http://</nowiki>www.youtube.com/watch?v='''0G1QZRPtstI'''
* <nowiki>http://</nowiki>www.youtube.com/watch?v='''0G1QZRPtstI'''&feature=related
* <nowiki>http://</nowiki>youtu.be/'''0G1QZRPtstI'''
 
<templatedata>
{
"params": {
"1": {
"aliases": [
"video"
],
"label": "Video",
"description": "Video ID (11-letter code) or URL",
"example": "0G1QZRPtstI",
"type": "line",
"required": true
},
"2": {
"aliases": [
"text"
],
"label": "Text",
"description": "Descriptive text",
"type": "string",
"suggested": true
},
"width": {
"label": "Width",
"description": "Video width in pixels",
"example": "300",
"type": "number",
"default": "300"
},
"height": {
"label": "Height",
"description": "Video height",
"example": "233",
"type": "number",
"default": "233"
},
"thumbs": {
"label": "Alignment",
"description": "Specify right or left to align left or right",
"example": "right"
}
},
"description": "Embed YouTube video",
"format": "inline"
}
</templatedata> </noinclude>
 
[[Category:Templates/Format]]</noinclude>

Revision as of 14:18, 4 August 2024

Template documentation (view)


Usage

{{YouTube|<video id>|<video size>|<location>|<caption>|height=|width=|file=}}

This template is used to create a thumbnail in which YouTube videos can be embedded. All such videos should be placed under a Videos section heading. The parameters are as follows:

  • video id is the unique sequence of letters, numbers, and characters found at the end of the video's URL.
  • video size is the desired size of the video. Defaults to 250px.
  • location is where to position the float of the video (i.e. right, left, or center). Defaults to left if blank.
  • caption is text that will be displayed in the thumbnail below the video.
  • height is the height of the bounding box. Defaults to 250px.
    • For best practice, all videos that are grouped together should have the same height, otherwise they may be displayed strangely on the page. Height will only need to be set manually if the videos drastically differ in the length of their captions such that some take up multiple lines and others less.
  • width is the width of the bounding box. Defaults to 200px.
  • file overrides the YouTube video and should only be used in the event that a video that was previously available on YouTube is removed.

Example

{{YouTube|kEJXS0MiKOA|250|left|Teaser from Nintendo Direct on September 13, 2018}}

Template:YouTube

When grouping videos, the same height must be set for all of them to avoid visual placement issues. This will need to be done manually if the length of their captions greatly differ.

{{YouTube|kEJXS0MiKOA|250|left|Teaser from Nintendo Direct on September 13, 2018|height=230px}}
{{YouTube|_3YNL0OWio0|250|left|E3 Nintendo Direct Trailer 2019|height=230px}}
{{YouTube|dEh3MPy4GAU|250|left|E3 Nintendo Treehouse gameplay featuring [[Aya Kyogoku]] and [[Hisashi Nogami]]|height=230px}}

Template:YouTube Template:YouTube

Template:YouTube