Script keeps changing in wysiwyg / HTML mode

11 posts by 3 authors in: Forums > CMS Builder
Last Post: June 20, 2013   (RSS)

My client is trying to add a BrowseAloud Logo (http://www.browsealoud.com/) to a wysiwyg field in CMSB. He clicks on the HTML button, then pastes the snippet of code that BrowseAloud supplies:

<script type="text/javascript">var _baLocale = 'us';var _baUseCookies = true; var _baMode = 'logo'; var _baHiddenMode = false; var _baHideOnLoad = false;</script>
<script type="text/javascript" src="http://www.browsealoud.com/plus/scripts/ba.js"></script>

However, after he saves it, it changes to this:

<script type="text/javascript">// <![CDATA[
var _baLocale = 'us';var _baUseCookies = true; var _baMode = 'logo'; var _baHiddenMode =
false; var _baHideOnLoad = false;
// ]]></script>
<script type="text/javascript"></script>

I tried it myself, with the same result.

Any idea why it’s changing, or is this sort of script not supported by CMSB?

By rconring - June 18, 2013 - edited: June 18, 2013

Scripts need to be placed in a TEXT BOX field rather than WYSIWYG so they are inserted as text, not HTML.

Ron Conring
Conring Automation Services
----------------------------------------
Software for Business and Industry Since 1987

Thanks for the reply, Ron.

That doesn't seem to apply with other code that I've pasted into a wysiwyg field that's in HTML mode; for example, YouTube embedding, or Google analytics. Any idea if there's a work around for this, please? My client is using the wysiwyg field for other information, too. It controls the pale blue panel that's in the bottom right of this page: http://www.wilmot.ca/.

Cheers.

By rconring - June 19, 2013 - edited: June 19, 2013

I think you will find that, in this case, it should work anyway in the altered state.  I have many BBB scripts that have been inserted into WYSIWYG fields and work just fine even though they were altered in the same manner by the editor.  the CDATA code has to do with XML rendering.  I have had problems in the past with some scripts that would only work when placed in a text field, so I try to make all script injection fields TEXT and have had no more problems.

Ron Conring
Conring Automation Services
----------------------------------------
Software for Business and Industry Since 1987

By CommonSenseDesign - June 19, 2013 - edited: June 19, 2013

Thanks, Ron. I didn't think to check that the altered code was actually working!

EDIT: Okay, now that I've checked, the code isn't working as it's supposed to. There should be a logo appearing where the code is placed, but nothing is showing up.

I wonder if this is a version issue? I tried it on version 2.15, which is on my server, and it works okay. However, my client is using version 2.07, and nothing shows up. That being said, the code is being changed the same way when I paste the code into the HTML mode on both sites, but it only works correctly on mine.

Hi, Greg.

No, I'm not getting any error messages at all when I test for confilcts.

By gregThomas - June 19, 2013

Hi,

Please could you fill in a second level support request for me? You can find the form here:

https://www.interactivetools.com/support/email_support_form.php

Then I can take a closer look into what is causing the problem. 

Thanks!

Greg

Greg Thomas







PHP Programmer - interactivetools.com

By rconring - June 19, 2013 - edited: June 19, 2013

Well, just for kicks, I checked it in both types of fields and it displays the logo in both ... just returns message when clicked that website is not registered with BrowseAloud.  Greg can probably figure it out for you.

Ron Conring
Conring Automation Services
----------------------------------------
Software for Business and Industry Since 1987

Done!