Sorry, can't get your problem. Can you show us an exemple or be more specific?
I am using rich text editor in my site to authoring content with rich features. When i edited the content using this editor and assign 'id' attribute to the <div> tag, after clicking Ok button of the editor, id attribute of the div tag is stripped.
i have given the text as shown below using rich text editor and clicked on Ok button.
<div id="ref_1"> reference text <div>
Again i opened the same text in rich text editor, now its looking like this
<div> reference text <div>
Please let me know if you need any other information.
I am looking to implement the following feature in my site.
Assigning a superscript at the end of the sentence which has a reference link to other content in the same page. when the user clicks on the superscript link, the page is adjusted to show that reference link. To implement this feature, i need to assign a id attribute to the div tag.
Set component to use misctools -> sourceedit, then enable it.
Click on the source edit button to edit html, This should work without stripping div id.
I had set the feature(misctools-> sourceedit) as suggested but the problem still persists.
Yes, i followed that step
I have clicked on the HTML source edit button and edit the source as in below
<div id="ref_1"> Reference </div> and Clicked on Ok button of the editor.
Again i opened the text in editor and clicked on HTML source edit button to see
whether my changes are reflected. The div tag is being displayed as in below without id attribute
<div> Reference </div>
Setting property idAttribMode (on htmlRules -> serializer -> config) to "keep" should prevent removing the id attributes, but note that this might cause other problem. What is your use case?
The solution which you given is working. id attributes are retaining after editing. You mentioned that it might cause other problem. Could you please mention the problems?
If the id matches with the one you supplied the ui may clutter. Test the component throughly.
Can you specify how to :
Setting property idAttribMode (on htmlRules -> serializer -> config) to "keep" should prevent removing the id attributes?
under my text component
1). /my_text/dialog/items/text/, I create a node "htmlRules" , value = nt:unstructured (I also have another node called "rtePlugins")
2). do I need to create another node under "htmlRules" called "serializer"? then another node called "config" under "serializer"?
3). where and how I can set the value = "keep" for "config".
Thanks for your help.
1) Under /apps/<yourApplication>/my_text/dialog/items create htmlRules/serializer/config nodes of type nt:unstructured. So, will end up with /apps/<yourApplication>/my_text/dialog/items/htmlRules/serializer/config.
2) Under "config" node create idAttribMode property and set it to "keep".
It will be like
thanks for the details. It works!
I have another related question.
I used to able put the
<link href="design.css" rel="stylesheet" type="text/css" />
in the rich text editor in CQ5.3 (I know it is probably not the right way to do it but we have a lot ad-hoc pages come and go, so we cannot integrate the CSS stylesheets into our main page templates).
Now, given the CQ5.5 rich text editor can keep the CSS ids, but it removes the html <link> tag, as well as the <script> tag too.
Is there a way to configure the rich text editor to retain these tags?
1 person found this helpful
will not be supporting use of the script, style, meta, and link tags in the product officially. This is due to the fact that it is not valid html to allow them in the document body.
I am facing the same problem in 5.5, in that, it is still stripping the ids from the RTE editor. I tried the solution above, in 5.5, and it didn't make a difference i.e. the ids are still being stripped.
I'm running into the same problem with CQ5.5. Did you get a response from support?
For those who might run into this issue, the htmlRules node needs to be created under the text node (the text node is the cq:Widget primary type with xtype as richtext).
I used this article to find the solution
Notice in the section titled "Styles and Protocols Allowed when Pasting Links", it says create the node under items/text
I am using CQ 5.6 and followed the instructions in the documentation, to create htmlRules node under the text node (the text node is the cq:Widget primary type with xtype as richtext).
But with no luck. Any suggestions would be appreciable.
I'm also facing the same problem with cq5.6. I followed the same approach but it was not worked in 5.6. Is there any other way to persist div ids in rte of cq5.6? Please suggest me the solutions.
Did you find any solution for this? Please suggest me the solution if you got the solution.
I used the htmleditor as I was not able to solve the problem with rich text editor. You can use xtype htmleditor and it is persisting the div ids.
Okay. But I have requirement that I have to include images using rich text editor. But in htmleditor widget, we can not drag and drop the images into it. So I used rich text editor. Okay. Thank you for your response. Please let me know if there is any other solution for this problem except that replace rich text editor by htmleditor.
Even I am looking into the solution and not sure about the approach.
Probably raise the seperate new issue in adobe forum, so that some one from Adobe would have a look at it and suggest some thing.
Pls let me know if you get to any solution/approach.
Did anybody get a solution for this in 5.6? I used the htmlRules solution in 5.4 successfully, but in 5.6 it is not working.
Here it is . . . . . .
Create a folder structure similar to "/libs/cq/ui/rte/core/HtmlSerializer.js" in apps as "/apps/cq/ui/rte/core/HtmlSerializer.js". Make sure that the folder structure and node types are as same as in libs. Then set "idAttribMode" to "keep" in "_init" function of HtmlSerializer.js. It will work