How to allow Javascript in Umrbaco richtext editor
I have pages that have different java script slider scritps i need to add it in different pages how do i allow javascripts in different pages in the rich text editor
You can do this by disabling tidy in the umbracoSettings.config - however I don't recommend you do this. Allowing people to insert javascript in the RTE is never a good idea, since it can break havoc on the site if people don't know what they're doing.
Is it a requirement that you insert the script directly in the rich text area? It really should be used for content only...not functionality.
Would'nt it be possible for you to solve it by creating a macro, which can take parameters and contain the neccesary scripting. Then you can insert that macro into your rich text editor and make it all work.
Since this post was never marked as solved, I thought I would post my similar problem. We currently have many (100s) of videos stored in our cloud service and as of right now we can't embed them like you would a YouTube video. We have to use raw javascript with parameters to make the videos play on our sites. Because we have so many videos, I don't see how a macro would help as there would have to be a macro for EVERY single video. I wanted to make it easy for our marketing team to insert videos. This project is a very large one. We are converting our old lecture software to a web-based application and there are several "slides" with videos.
I have tried creating a macro and it does work but I don't want them to have to create one for every video like a said above. I have also tried removing the valid elements from TinyMCE and turning off Tidy but that doesn't work. It moves the <script> tags outside of the CDATA tags so nothing is displayed on the site. If I manully move the script tags back in then all I see is the javascript code on the site.
I am using the latest Umbraco. Any help would be greatly appreciated
How to allow Javascript in Umrbaco richtext editor
I have pages that have different java script slider scritps i need to add it in different pages how do i allow javascripts in different pages in the rich text editor
Hi Max
You can do this by disabling tidy in the umbracoSettings.config - however I don't recommend you do this. Allowing people to insert javascript in the RTE is never a good idea, since it can break havoc on the site if people don't know what they're doing.
Is it a requirement that you insert the script directly in the rich text area? It really should be used for content only...not functionality.
Would'nt it be possible for you to solve it by creating a macro, which can take parameters and contain the neccesary scripting. Then you can insert that macro into your rich text editor and make it all work.
Could this be the proper solution for you?
/Jan
yes using macro is also agood idea but how to put javascript in xslt macros any links or solutions wil be useful
Hi Max
Is the script you're using something custom made or is it based on existing jQuery sliders for example?
What specific script di you need to insert?
usually scripts are inserted in xslt as character data like this example here: http://www.w3schools.com/xml/xml_cdata.asp
Usually I do it this way in my XSLT files.
<xsl:text disable-output-escaping="yes">
<![CDATA[
<script type="text/javascript">
//js here...
</script>
]]>
</xsl:text>
Does it make sense?
/Jan
yes it was very useful indeed
Hi Max
I'm happy to hear that.
If it solved your issue could you then please mark this post as solved? :-)
Cheers.
/Jan
Jan,
Since this post was never marked as solved, I thought I would post my similar problem. We currently have many (100s) of videos stored in our cloud service and as of right now we can't embed them like you would a YouTube video. We have to use raw javascript with parameters to make the videos play on our sites. Because we have so many videos, I don't see how a macro would help as there would have to be a macro for EVERY single video. I wanted to make it easy for our marketing team to insert videos. This project is a very large one. We are converting our old lecture software to a web-based application and there are several "slides" with videos.
I have tried creating a macro and it does work but I don't want them to have to create one for every video like a said above. I have also tried removing the valid elements from TinyMCE and turning off Tidy but that doesn't work. It moves the <script> tags outside of the CDATA tags so nothing is displayed on the site. If I manully move the script tags back in then all I see is the javascript code on the site.
I am using the latest Umbraco. Any help would be greatly appreciated
is working on a reply...