Javascript Problem

Help with getting the CMS CORE package up and running. This does not include 3rd party modules, PHP scripts, anything downloaded via module manager or from any external source.
Locked
krayzee
Forum Members
Forum Members
Posts: 10
Joined: Wed Apr 21, 2010 7:23 pm

Javascript Problem

Post 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!
Jos
Support Guru
Support Guru
Posts: 4020
Joined: Wed Sep 05, 2007 8:03 pm

Re: Javascript Problem

Post 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.
Deak

Re: Javascript Problem

Post 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?
krayzee
Forum Members
Forum Members
Posts: 10
Joined: Wed Apr 21, 2010 7:23 pm

Re: Javascript Problem

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

Re: Javascript Problem

Post 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...
Locked

Return to “[locked] Installation, Setup and Upgrade”