Embedded Item Content Type (YouTube)

Options

Hello!

I'm trying to create a template for my YouTube videos but my HTML code does not seem to work.

I got this one from my CMS200 class - it worked during class but not for my org's site.

<object data="http://www.youtube.com/v/$youtube_id" height="350" type="application/x-shockwave-flash" width="425">

<param name="wmode" value="transparent" />

<param name="src" value="http://www.youtube.com/v/$youtube_id" />

</object>

I tried changing it to this, but still no luck.

<object data="http://www.youtube.com/v/{youtube_id}" height="350" type="application/x-shockwave-flash" width="425">

<param name="wmode" value="transparent" />

<param name="src" value="http://www.youtube.com/v/{youtube_id}" />

</object>

Any ideas I can try out?

Tagged:

Comments

  • Ruby in order to bring in the youtube ID parameter you must use the ${field_name} syntax, not $field_name or {field_name}.

    If you have a field in your content type named youtube_id you will be able to get it's value by entering the following in the template ${youtube_id}.

    Let me know if this does not fix your issue.

  • Elizabeth M:

    Ruby in order to bring in the youtube ID parameter you must use the ${field_name} syntax, not $field_name or {field_name}.

    If you have a field in your content type named youtube_id you will be able to get it's value by entering the following in the template ${youtube_id}.

    Let me know if this does not fix your issue.

    Hi Elizabeth - this still isn't working for me. Any ideas as to what can be causing this not to work?

  • Ruby Ong:

    Hi Elizabeth - this still isn't working for me. Any ideas as to what can be causing this not to work?

    Ruby,

    Upon closer examination I see that your embed code is not correct, it's always good to grab a code from a live YouTube video & then change the parameters. Parameter for the movie must be named "move" rather than "src", which is the parameter of the <embed> tag.

    Here's an example:

    <object width="640" height="385">

      <param name="movie" value="http://www.youtube.com/v/6e26ao4PZkg&amp;hl=en_US&amp;fs=1">  </param>

      <param name="allowFullScreen" value="true">  </param>

      <param name="allowscriptaccess" value="always">  </param>

    <param name="wmode" value="transparent" />

      <embed src="http://www.youtube.com/v/6e26ao4PZkg&amp;hl=en_US&amp;fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" wmode="transparent" width="640" height="385"></embed>

    </object>

Categories