Wikia

Community Central

Talk:YouTube

79,357pages on
this wiki

Back to template

This function has been replaced & improved with the Video Embed Tool -- please see Help:Video Embed Tool for details.

Contents

UsageEdit

{{YouTube|caption|<youtube width="250" height="200">youtube code</youtube>}}

Example use
Craigslist Foundation Non-Profit Bootcamp Podcasts

This template shows a YouTube video with a default size of 250px in width.

  • The first parameter is the caption which appears above the video; this can contain standard wikitext.
  • The second is the full text of the <youtube> extension code, which contains editable extension parameters for:
    • width and height (maximum 425x350 pixels).
    • youtube code (the alphanumeric code after the equals sign at the end of a YouTube URL).

Example useEdit

{{YouTube|'''Example use'''<br />Craigslist Foundation ''Non-Profit'' Bootcamp [[Podcasts]]|<youtube width="200" height="160">zLJKedGAEY8</youtube>}}



NotesEdit

Because of the order in which the template and the extension are processed, the <youtube> extension code cannot contain template parameters itself.

A template containing code such as <youtube width="{{{1}}}" height="{{{2}}}">{{{3}}}</youtube> will not function unless the template is always substituted.

If you wish to always display videos at a larger or smaller size, edit the template (on your wiki) to alter the default width and height in the youtube extension code. You must also alter the width code (style="width:256px;") in the first line of the template to equal the default width plus 6 pixels, to allow for the padding specified in the stylesheet.

The maximum size is 425x350 pixels. For best results, the height should be about 4/5 (80%) of the width. Some examples of good ratios include 125x100, 200x160, and 250x200.

DiscussionEdit

Use the parser function format instead Edit

You're right in saying the tag itself cannot contain template parameters. Simply use the parser function format. I have completely no idea why the tags are used so much as they have so many limitations, and why this format isn't mentioned anywhere at all:

{{#youtube:<<<youtube code>>>|<<<height>>>|<<<width>>>}}

and you can insert whatever functions you want inside each of the parameters.

p.s. I hate the tag format. Same as <dpl> </dpl> vs. {{#dpl:}} ugh.

Thank you, that works a million times better. It works perfectly in templates too.
KawaTsuyo Message 19:57, January 17, 2013 (UTC)

Photos

Add a Photo
12,108photos on this wiki
See all photos >

Recent Wiki Activity

See more >

Around Wikia's network

Random Wiki