Page 1 of 1

[Solved]Text editor changing code

Posted: Sun Aug 04, 2013 6:23 am
by jasnick
Using CMSMS 1.11.7 and latest modules

Setting up a Video Gallery page using VideoLightBox. Finally got it working only to find that after I exited from Admin then re-opened Admin later, it had stopped working at the stage where it should have started playing the video.

After much checking, I discovered (in Admin) that the code I had pasted into the page had changed a little.

Working code:

<!-- Start VideoLightBox.com BODY section -->

<__script__ type="text/javascript">

function onYouTubePlayerReady(playerId) {
ytplayer = document.getElementById("video_overlay");
ytplayer.setVolume(100);
}

</__script>
<div id="videogallery">
<a rel="#voverlay" href="uploads/videos/engine/swf/player.swf?url=../../data/video/black_marlin_dampier_wa_2012_.flv&volume=100" title="Black Marlin Dampier WA 2012 "><img src="uploads/videos/data/thumbnails/black_marlin_dampier_wa_2012_.png" alt="Black Marlin Dampier WA 2012 " />Black Marlin Dampier WA 2012</a><a id="videolb" href="http://videolightbox.com">Video in Popup by VideoLightBox.com v1.11</a>
</div>
<!-- End VideoLightBox.com BODY section -->

Non-working code:
After Submit, the page plays correctly. However, if I go back into Admin and edit the page again, I find the code has changed to:

<!-- Start VideoLightBox.com BODY section -->
<__script__ type="text/javascript">// <![CDATA[
function onYouTubePlayerReady(playerId) {
ytplayer = document.getElementById("video_overlay");
ytplayer.setVolume(100);
}
// ]]></__script>
<div id="videogallery"><a title="Black Marlin Dampier WA 2012 " href="uploads/videos/engine/swf/data/video/black_marlin_dampier_wa_2012_.flv&volume=100" rel="#voverlay"><img src="uploads/videos/data/thumbnails/black_marlin_dampier_wa_2012_.png" alt="Black Marlin Dampier WA 2012 " />Black Marlin Dampier WA 2012 </a><a id="videolb" href="http://videolightbox.com">Video in Popup by VideoLightBox.com v1.11</a>
</div>
<!-- End VideoLightBox.com BODY section -->

In the page metadata is:<!-- Start VideoLightBox.com HEAD section -->
{literal}
<link rel="stylesheet" href="uploads/videos/engine/css/videolightbox.css" type="text/css" />
<style type="text/css">#videogallery a#videolb{display:none}</style>
<link rel="stylesheet" type="text/css" href="uploads/videos/engine/css/overlay-minimal.css"/>
<__script__ src="uploads/videos/engine/js/jquery.tools.min.js"></__script>
<__script__ src="uploads/videos/engine/js/swfobject.js"></__script>
<!-- make all links with the 'rel' attribute open overlays -->
<__script__ src="uploads/videos/engine/js/videolightbox.js"></__script>
{/literal}
<!-- End VideoLightBox.com HEAD section -->

The change in the order of the code has stopped the video playing. The overlay opens but no black box with video. In other words, the first mentioned code works, the second doesn't. Is there anything that can be done to stop TinyMCE changing the code? I was using MicroTiny initially but changed to TinyMCE in case it made a difference.

Thanks

Re: Text editor changing code

Posted: Sun Aug 04, 2013 9:35 am
by Jo Morg
WYSIWYG editors are known to change code: normally it's by design. They are not meant to input HTML, except for a few tags needed for basic formating. AFAIK TinyMCE may have a setting to allow some extra tags whereas MicroTiny doesn't.
The best solution (and there are several already posted on the forum that a search may reveal) would be to use an UDT or a GCB with the code and to call either with a parameter that would be the filename of the source video.
HTH

Re: Text editor changing code

Posted: Sun Aug 04, 2013 11:57 pm
by jasnick
Thanks Jo Morg - I am obviously not using the correct search terms as I have not found much to help me. I will research your suggestions as I really want to achieve this layout if I can.

Thanks again!

Re: Text editor changing code

Posted: Mon Aug 05, 2013 12:09 am
by Jo Morg

Re: Text editor changing code

Posted: Mon Aug 05, 2013 12:11 am
by jasnick
Can it be that easy? I just added the working code into GCB and it works!

Re: Text editor changing code

Posted: Mon Aug 05, 2013 7:48 am
by velden
Please add '[solved]' to topic title.

If you only need to paste the video code in that page you could also choose to disable wysiwyg editor for that page only.

In the options tab check: 'Disable WYSIWYG editor on this page (regardless of template or user settings)'

Re: Text editor changing code

Posted: Mon Aug 05, 2013 7:57 am
by jasnick
Sorry, velden - I was waiting to make sure it WAS solved. Yes, I did go in and disable WYSIWYG in the settings!

Thanks