you tube codes stopped working

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Post Reply
ozdecor
Forum Members
Forum Members
Posts: 15
Joined: Mon Sep 07, 2009 12:45 am

you tube codes stopped working

Post by ozdecor »

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
User avatar
M@rtijn
Power Poster
Power Poster
Posts: 706
Joined: Sat Nov 14, 2009 4:54 pm

Re: you tube codes stopped working

Post by M@rtijn »

There is a Youtube Module: http://dev.cmsmadesimple.org/project/fi ... ackage-865

Worked like a charm on one of my projects
Make your community a better place!
ozdecor
Forum Members
Forum Members
Posts: 15
Joined: Mon Sep 07, 2009 12:45 am

Re: you tube codes stopped working

Post by ozdecor »

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
Jeff
Power Poster
Power Poster
Posts: 961
Joined: Mon Jan 21, 2008 5:51 pm

Re: you tube codes stopped working

Post by Jeff »

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.
ozdecor
Forum Members
Forum Members
Posts: 15
Joined: Mon Sep 07, 2009 12:45 am

Re: you tube codes stopped working

Post by ozdecor »

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
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: you tube codes stopped working

Post by Dr.CSS »

Tiny eats code like that, best to put it in GCB then call that in page content edit box...
scooper
Forum Members
Forum Members
Posts: 242
Joined: Fri Dec 09, 2005 12:36 pm

Re: you tube codes stopped working

Post by scooper »

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:

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;

And then in your page content you can then add a tag in the form:

Code: Select all

{youTube code="H4O8_InlyYs"}
where 'code' is the id of your video. You can also pass height, width and autoplay parameters.

Hope it helps.

s.
Post Reply

Return to “CMSMS Core”