21278 Posts in 5728 Topics by 2599 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 1293 Views |
-
Script doesn't stay in editor

7 July 2009 at 7:43am
I have the following script:
<div id="heyzap_games_medium" style=""></div>
<script type="text/javascript" src="http://www.heyzap.com/javascripts/embed.external.js"> </script>
<style> @import 'http://www.heyzap.com/elightbox/lightbox.external.css'; </style>
<script type="text/javascript">
var heyzap_medium = new Heyzap( 'heyzap_games_medium', {"embed_key":"8840962768"} );
heyzap_medium.renderMini( null, 'medium' );
</script>
<a target="_blank" href="http://www.heyzap.com">heyzap.com - embed games</a>Why doesn't this kept saved in the wysiwyg editor? I put it in there in HTML mode. For other embedded scripts there is no problem. Only for this one
-
Re: Script doesn't stay in editor

7 July 2009 at 12:34pm Last edited: 7 July 2009 12:34pm
The WYSIWYG editor strips many normal HTML tags as a security precaution.
What is different about this snippet from the others that have been successfully saved? I'm picking that it's the javascript or the @import statement.
Cheers
Aaron -
Re: Script doesn't stay in editor

7 July 2009 at 9:28pm
Yes that could be it.
How can i solve this easily?
Add an extra field in a Page page with only html ?
-
Re: Script doesn't stay in editor

8 July 2009 at 2:12pm
The TinyMCE (the WYSIWYG editor) config has changed a fair bit between SS versions, which version of SS are you working with?
Also, how are you using these other scripts that work? as far as I can see (in v2.3.2 at least) the script tag is not allowed and will get stripped out. same goes for style.
TinyMCE can be configured to allow additional tags and attributes, how you do this depends on the version of SS you are running.
Cheers,
Rich
-
Re: Script doesn't stay in editor

8 July 2009 at 2:27pm Last edited: 8 July 2009 2:28pm
This is a TinyMCE config thing, not SS related.
Check this out for guidance:
http://wiki.moxiecode.com/index.php/TinyMCE:Configuration/valid_elementsThere are also a few posts in the archive forum on this, do a search through that. Here's one that I remember: http://silverstripe.org/archive/show/202803#post202803
Cheers
Aaron -
Re: Script doesn't stay in editor

8 July 2009 at 8:46pm Last edited: 8 July 2009 8:48pm
Thnx!
I found the solution in this topic: http://www.silverstripe.org/archive/show/128480
Just take out all the elements lol
-
Re: Script doesn't stay in editor

29 September 2009 at 5:10am
this does not work in my version of SS. (ver 2.3.3)
there is not file named /cms/javascript/tinymce.template.js
i did find an entry for valid_elements but it was already something like "*- "
and I cannot add a <script> tag, so here is what i did.
I did find an entry in /cms/code/LeftAndMain.php for valid_elements
and added ",script[src|type]" to the long list of valid_elements and then did the ?flush=1 thing and it seemed to work.
hope that helps someone else.
- "
| 1293 Views | ||
|
Page:
1
|
Go to Top |


