The way we normally do it on my work is like whenever we need to put a piece of javascript on one of the sites, we tend to use the textbox multiple to place the javascript code in instead of place the javascript code inside the RTE (unless I'm having the script inside one the specific macro of course ).
The textbox multiple will not strip any of the script that you inserted into it.
So this could maybe be the solution for you too to solve your issue with Javascript inside the RTE.
Just a quick one, the artcile you linked to, mentions addingthe CDATA markup to validElements, but did you add the script tags to
This might be why it's cleaning the closing tag??
Also, are the scripts pre-defined, so the user can choose? eg. Carousel script, Model script, Fancy Script, ect??
If this is the case why not use the ClientDependancyFramework and present a checkbox list of scripts undeer the RTE field (labeled something like "Scripts to include with RTE") so the editor can pick the scripts?
You don't need the Javascript executing within the actual editor do you? just on display right?
RTE and javascript
Hi,
I'm trying to allow editors to insert js into a RTE. I've followed this: http://our.umbraco.org/wiki/how-tos/customizing-the-wysiwyg-rich-text-editor-(tinymce)/allow-any-markup-in-the-tinymce-editor
but when inserting a script-tag, for example:
I come out like this when rendering with @Html.Raw(CurrentPage.bodyText)
Missing a closing tag and all. What to do?
Hi Tom,
The way we normally do it on my work is like whenever we need to put a piece of javascript on one of the sites, we tend to use the textbox multiple to place the javascript code in instead of place the javascript code inside the RTE (unless I'm having the script inside one the specific macro of course ).
The textbox multiple will not strip any of the script that you inserted into it.
So this could maybe be the solution for you too to solve your issue with Javascript inside the RTE.
Hope this helps,
/Dennis
yeah, thanks. Guess thats the only viable way.
Anyone who successfully have gotten scripts to work in the RTE? My editors needs to be able to insert scripts all kinds of places...
Just a quick one, the artcile you linked to, mentions addingthe CDATA markup to validElements, but did you add the script tags to
This might be why it's cleaning the closing tag??
Also, are the scripts pre-defined, so the user can choose? eg. Carousel script, Model script, Fancy Script, ect??
If this is the case why not use the ClientDependancyFramework and present a checkbox list of scripts undeer the RTE field (labeled something like "Scripts to include with RTE") so the editor can pick the scripts?
You don't need the Javascript executing within the actual editor do you? just on display right?
Kind Regards,
Danny "Blatant"
is working on a reply...