I am trying to write javascript in the RTE. I changed the TinyMCE config to accept "script[language|src|type]" in the validElements. This works only if you don't save it. After you save the JS in the RTE I get a "[tidy error]" output in the RTE and in the HTML.
I see it puts the CDATA inside the script tags in the RTE if you try to let the RTE accept the script[language|src|type] but I am having a feeling that the CDATA stuff is causing the [tidy error] output.
Any suggestions? I tried making an XSLT file so I can use the Macro in my custom property, BUT I am having an issue with my custom property using the RTE to render the Macro in the HTML. I have posted my other dilemma here.
Jan, yes that other post is what I am trying to do. I am trying to make an Macro spit out the Javascript. I was thinking I could get around it by placing the Javascript directly inside of the RTE. I am trying to put a Twitter script inside the editor area. We have other pages using the same template, so I only want the script to show up in one part of the site and not all the other pages that use the same template.
Just a small note. Whenever I need to put a piece of javascript on one of my sites, I tend to use the textbox multiple instead of a RTE (unless I'm having the script inside one of my macros 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.
But is it not possible to create another macro for this, that you can place in the RTE? Or am I missing it totally?
Otherwise...have you considered creating another template for the node in question? On the document type you can then select the template to be allowed to be used on this document type.
On the node you can use this specific template for this site only and then you can create the twitter feed in there and then it will only be shown in that specific page.
Jan, Kim figured it out on the last post about the other issue I was having.
It is hard to explain through a forum and text unless I were to try to show this issue real time. I guess using the multiple text box could be an solution too. Although my content authors are not that HTML savvy. Oh well.
Thanks for the help. I really enjoy the help on these forums.
But otherwise consider using an alternate template if it's possible. What you're doing sounds to be a bit complex and easy to cause confusion (I know that I tend to spend some time to "get" old code written a couple of month ago - So the simpler the better, right? :))
But it's great that you have got your issue solved and is able to move on to the next task :-)
Javascript in RTE
I am trying to write javascript in the RTE. I changed the TinyMCE config to accept "script[language|src|type]" in the validElements. This works only if you don't save it. After you save the JS in the RTE I get a "[tidy error]" output in the RTE and in the HTML.
I see it puts the CDATA inside the script tags in the RTE if you try to let the RTE accept the script[language|src|type] but I am having a feeling that the CDATA stuff is causing the [tidy error] output.
Any suggestions? I tried making an XSLT file so I can use the Macro in my custom property, BUT I am having an issue with my custom property using the RTE to render the Macro in the HTML. I have posted my other dilemma here.
If anyone has suggestions please let me know.
Thanks.
Hi Carlos
You could disable tidy in umbracoSettings.config I suppose but I really don't recommend that. JavaScript in the rich text editor should be avoided.
Why do you need to insert it into the RTE?
I think I have also made an answer to the reffered post if my mind is not playing tricks on me :-)
/Jan
Jan, yes that other post is what I am trying to do. I am trying to make an Macro spit out the Javascript. I was thinking I could get around it by placing the Javascript directly inside of the RTE. I am trying to put a Twitter script inside the editor area. We have other pages using the same template, so I only want the script to show up in one part of the site and not all the other pages that use the same template.
Hi Carlos
Just a small note. Whenever I need to put a piece of javascript on one of my sites, I tend to use the textbox multiple instead of a RTE (unless I'm having the script inside one of my macros 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.
/Kim A
Hi Carlos
I can understand that.
But is it not possible to create another macro for this, that you can place in the RTE? Or am I missing it totally?
Otherwise...have you considered creating another template for the node in question? On the document type you can then select the template to be allowed to be used on this document type.
On the node you can use this specific template for this site only and then you can create the twitter feed in there and then it will only be shown in that specific page.
/Jan
Jan, Kim figured it out on the last post about the other issue I was having.
It is hard to explain through a forum and text unless I were to try to show this issue real time. I guess using the multiple text box could be an solution too. Although my content authors are not that HTML savvy. Oh well.
Thanks for the help. I really enjoy the help on these forums.
Hi Carlos
Yes, it was good to see.
But otherwise consider using an alternate template if it's possible. What you're doing sounds to be a bit complex and easy to cause confusion (I know that I tend to spend some time to "get" old code written a couple of month ago - So the simpler the better, right? :))
But it's great that you have got your issue solved and is able to move on to the next task :-)
/Jan
is working on a reply...