I am trying to create a Editor component that will take inline javascript. I understand that I can use clientlibs folder for loading JS, but as per my requirement they want to use embed tags with JavaScript in the editor, and I think some of that is also used for rapid development. Currently with the state of RTE, I cannot put a script <script/>
tag even after extending it, as it strips it out and only takes the html tags. Same in the case of CSS <style/> tags.
Solved! Go to Solution.
Views
Replies
Total Likes
You can use the HTML view to modify HTML tags such as ul, ol, li, etc. However - you cannot place real scripts in there and fire them. To get scripts to work in a component, you typically use clientlibs and set categories - not try and write script tags in the RTE.
Views
Replies
Total Likes
When you say Rich Text Editor component - what is the resource type of that component? Do you mean the Text component where a RTE shows up in a dialog box?
Views
Replies
Total Likes
resource super type : foundation/components/text
I have attached few images what exactly happening when use script and css tags. Please let me know if u need more clarification.?
Thanks in advance.
Views
Replies
Total Likes
You - are are trying to use the RTE as a JS script client and fire off DOM/JS commands. This is not supported as RTE is only a text editor - not a JS client.
Views
Replies
Total Likes
Hi Vijay,
I agree with Scott - RTE is only a text editor and it won't supports Java script.
If you want to really use JS, you need to create your own custom component.
See here Sreekanth's blog - There are many articles on RTE which they put JS in client libraries.: http://experience-aem.blogspot.in
~ Ratna.
Views
Replies
Total Likes
Hi Scott I agree. But this is a OOTB component. Where we are trying to use this component exclusively for few users . It was termed it as HTML Source Enabled component. Is there no way to develop a component that takes style and scrip tags. ??
And there are any plugins are need to be modified to make work this component? plugins meaning js files??
Views
Replies
Total Likes
I agree. But this is a OOTB component. Where we are trying to use this component exclusively for few users . It was termed it as HTML Source Enabled component. Is there no way to develop a component that takes style and scrip tags. ??
And there are any plugins are need to be modified to make work this component? plugins meaning js files??
Views
Replies
Total Likes
You can use the HTML view to modify HTML tags such as ul, ol, li, etc. However - you cannot place real scripts in there and fire them. To get scripts to work in a component, you typically use clientlibs and set categories - not try and write script tags in the RTE.
Views
Replies
Total Likes
Thanks Scott
Views
Replies
Total Likes
For example - you want to get JS workign with a Sightly (HTL) component -see:
http://scottsdigitalcommunity.blogspot.ca/2016/06/creating-aem-sightly-component-that.html
Views
Replies
Total Likes
hi Scott,
there is any list of HTML tags that does not work in the HTML source editor. Previously I just thought it strips off script and style tags. Now same thing happening with the id attribute for example <div id = "xyz> </div>. even if I tried to insert form tags its taking later , it automatically changes from <form> </form> to <p> <form> </form></p>. Please let me know which tags usually work such HTMl source editor.
Thanks
Views
Replies
Total Likes
Views
Likes
Replies