Page 1 of 1

Javascript Problem

Posted: Thu Apr 22, 2010 8:51 am
by krayzee
First off... I tried the {literal}-tags, but its still not working.

Hi everyone!

I am trying to include a JS based slideshow gallery on my website. This calls to add code into the body of the website where the gallery should appear.

So I opened up my content page, opened the HTML viewer and added the code. When I click on Saving it converts to this:

Code: Select all

<h2><br />Impressionen aus unserer Zahnarztpraxis</h2>
{literal}
<__script__ type="text/javascript">// <![CDATA[
function startGallery() {
var myGallery = new gallery($('myGallery'), {
timed: true,
showArrows: true,
showCarousel: true,
embedLinks: false
});
}
window.addEvent('domready', startGallery);
// ]]></__script>
{/literal}
<div class="content">
<div id="myGallery">
<div class="imageElement">
<h3>Item 1 Title</h3>
<p>Item 1 Description</p>
<a class="open" title="open image" href="#"></a> <img class="full" src="images/Symbolrund.jpg" alt="" /> <img class="thumbnail" src="images/Symbolrund_T.jpg" alt="" /></div> ...................
It adds this weird CDATA, that I think is the problem. I can't get rid of it.

Can anyone help me? I can't put the slideshow in the template header or it will appear everywhere and not where I want it.

Thanks a lot!

Re: Javascript Problem

Posted: Thu Apr 22, 2010 9:01 am
by Jos
I guess TinyMCE makes a mess of the code. You can put the code in a GCB with the WYSIWYG editor turned off.

You can also use the Gallery module and make a new Gallery template where you put your javascript in. It will be included automatically in each page that has a {Gallery} call.

Re: Javascript Problem

Posted: Thu Apr 22, 2010 11:27 am
by Deak
If this is a TinyMCE issue, how about putting your JavaScript into a Global Content Block and including a call to that on your page instead?

Re: Javascript Problem

Posted: Mon Apr 26, 2010 5:20 am
by krayzee
Thanks for your replies... It's still not working in either way but I'm determined to figure it out!

I'll keep you updated.

Re: Javascript Problem

Posted: Fri Apr 30, 2010 8:35 pm
by Dr.CSS
If you are using this in a content box edit mode, try putting it in the Options tab meatadata box instead, then it will go in the where is should be...