Forum:Using the youtube extension in an infobox

Is there a way to embed the youtube extension youtubeid in an infobox so you only have to input the id itself, and not the code? What I currently have to do is either a) use the Video Embed Tool to "upload" a video to my wiki, copy the name in the File namespace, and paste it into the infobox, or b) use the youtube extension. The former is tedious and the latter problematic for new users because of the numbers involved (the height restriction is a community-approved stylistic choice for the kind of video the infobox is supposed to be for). So I'd like to design an infobox that has the normal video parameter for both those options, but that also has a 'youtube' parameter where a user only needs to paste the video id. I haven't had much success, unfortunately. I failed completely at getting a second video parameter (called 'youtube') to work even if the first was unspecified; my attempt to get the normal 'video' parameter to accept only the youtube video id failed as well. It looked like this (parameter only): I searched around a little and found this. Apparently the extension does not tend to play well with templates. So is what I want not doable at all? I had also planned to create parameters for width and height, but I guess that won't work then either. I don't know what to make of the comment in the final section of that talk apge since I've never used those "parser functions". --Tulipclaymore 00:55, April 30, 2012 (UTC)


 * Try this code instead:




 * Using that syntax, you can also create parameters for the dimensions i.e. . — Sovq 05:46, April 30, 2012 (UTC)
 * Thank you, that does indeed get the video to show up. But I must still be doing something wrong (possibly in the rest of the infobox somewhere). This is your code copied into a "clean" infobox (I removed the other video parameter). This is how it looks (third one; the first one is how it's supposed to look, the second an attempt to copy your code into the normal template, but without the style element). --Tulipclaymore 06:08, April 30, 2012 (UTC)


 * Template:Infobox_song_yt should work fine now. There was an excess line break causing the problem. — Sovq 18:21, April 30, 2012 (UTC)