hello We had you tube videos in pages, now we find that when we edit them the code vanishes
have tried the {literal} {/literal} around the code without success. What is the best way to embedd a youtude video in a page
IAn
you tube codes stopped working
Re: you tube codes stopped working
There is a Youtube Module: http://dev.cmsmadesimple.org/project/fi ... ackage-865
Worked like a charm on one of my projects
Worked like a charm on one of my projects
Make your community a better place!
Re: you tube codes stopped working
looked at that but it does not show on the page editor
Call ? but when the help says
To call the module, simply use the following tag:
{cms_module module="youtubeplayer"} or {cms_module module="youtubeplayer" alias="alias_of_item"}? Tried them in the page code (both sides of the wysiwyg editor)
where do i actually use that code?
and why has the youtube iframe code stopped working? - i could do it as a global block butthat is a bit of a overkill (or is it the only way)?
Ian
Call ? but when the help says
To call the module, simply use the following tag:
{cms_module module="youtubeplayer"} or {cms_module module="youtubeplayer" alias="alias_of_item"}? Tried them in the page code (both sides of the wysiwyg editor)
where do i actually use that code?
and why has the youtube iframe code stopped working? - i could do it as a global block butthat is a bit of a overkill (or is it the only way)?
Ian
Re: you tube codes stopped working
I turn off the wysiwyg editor (disable checkbox is halfway down on the options tab) for pages with embed code or js because TinyMCE will filter it when you save it.
Re: you tube codes stopped working
Is there a better way as when you have other content in the page it will look poor if the page creater does not know code (which most don't) - is the alternative globalblocks?
Ian
Ian
Re: you tube codes stopped working
Tiny eats code like that, best to put it in GCB then call that in page content edit box...
Re: you tube codes stopped working
I have a simple user defined tag (UDT) I use. It's pretty basic but works for me.
Create a UDT called 'youTube' with the following code:
And then in your page content you can then add a tag in the form:
where 'code' is the id of your video. You can also pass height, width and autoplay parameters.
Hope it helps.
s.
Create a UDT called 'youTube' with the following code:
Code: Select all
// write out an embed tag for a youtube vid.
$ytCode=$params['code'];
if(isset($params['height'])){
$height=$params['height'];
}else{
$height=385;
}
if(isset($params['width'])){
$width=$params['width'];
}else{
$width=640;
}
if(isset($params['autoplay'])){
$autoplay=$params['autoplay'];
}else{
$autoplay=0;
}
$vidString='<div>';
$vidString.='<object width="'.$width.'" height="'. $height .'">';
$vidString.='<param name="movie" value="http://www.youtube.com/v/' . $ytCode .'&hl=en_GB&fs=1&rel=0&autoplay=' . $autoplay . '"></param>';
$vidString.='<param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><param name="wmode" value="opaque"></param>';
$vidString.='<embed src="http://www.youtube.com/v/' . $ytCode .'&hl=en_GB&fs=1&rel=0&autoplay=' . $autoplay .'" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" wmode="opaque" width="' . $width .'" height="' . $height .'"></embed></object>';
$vidString.='</div>';
echo $vidString;
Code: Select all
{youTube code="H4O8_InlyYs"}
Hope it helps.
s.