We need to allow user to enter any html tag in the MCE Editor. Just for your information we are using Umbrac 7.2.1. Can any one please help us on this?
Here is an example of our sample html code with which we are experiencing problem :-
<div id="owl-example" class="owl-carousel">
<a href="#">
<div>DEF
</div>
</a>
</div>
When we review this code again in the Source Code editor this code got converted to
<div id="owl-example" class="owl-carousel">
<div>DEF</div>
</div>
This editor removed the anchor tag. Not sure why this issue is coming. How ever we resolved this issue by changing our html as mentioned below :-
Here we have replaced <span> with <div> tag inside <a> tag. We got some clue that <div> is not allowed inside <a> tag. But we would like to have <div> inside <a> tag as we have lots of html pages like this issue.
Can any one please help us as how to solve this issue?
We did some research and find some help like using "<validElements><![CDATA[*[*]]]></validElements>" in config/tinyMceConfig.config file but it didn't solve our problem.
The solution provided in the link referenced above does only allow for special attributes on image tags inserted, which was the issue Kim had.
Not sure how tidy is working and what it's looking at. And it should be disabled by default since the release of v4.9. So perhaps it's a bug...not sure.
But what are you scenarios for needing to put so much custom markup into the RTE field? Would'nt it be possible to use macroes instead? If you're doing caroussels etc. why don't keep the code in one maintainable place so it can easily be reused on other pages as well?
Please keep it in the same post - It makes it easier on yourself and others to see the suggestions given and what other issues might have arised since the original post etc :)
Our scenario is a bit different we want Editors to create pages them seleves so in case if they use html like that which i have mentioned in my last comment then there could be issues. That's why i ask you about my problem.
I hope you understand my scenario. Please let me know if more elaboration is required.
If my requirement is clear to you then please let me know if you have the solution for the problem mentioned in my last comment?
I'm not sure I fully get your scenario - What is the reason that the client will need to add specific HTML themselves? Is it if they want to add a widget from a 3rd party service like flickr, Youtube or something like that? Or is it if they want to layout the whole page by themselves?
Another option could perhaps be to simply use a textbox multiple field?
We have noticed that following tags are not supported in the Rich Text Box Editor (Tiny MCE Editor) while saving the html. After saving the html content which have these below mentioned tags we noticed that these tags got removed from the saved html.
<b>, <section>, <font>
Not sure why these tags are not getting supported.
I am on Umbraco 7.11.1 and trying to enable schema markups in the RTE. I've tried all solutions mentioned here but none of them work. I was hopefully Paul's solution would do the trick but it didn't.
From reading the documents this +div[*] should work but it didn't.
Allow any HTML Tag in the MCE editor
Hi All,
We need to allow user to enter any html tag in the MCE Editor. Just for your information we are using Umbrac 7.2.1. Can any one please help us on this?
Here is an example of our sample html code with which we are experiencing problem :-
<div id="owl-example" class="owl-carousel">
<a href="#">
<div>DEF
</div>
</a>
</div>
When we review this code again in the Source Code editor this code got converted to
<div id="owl-example" class="owl-carousel">
<div>DEF</div>
</div>
This editor removed the anchor tag. Not sure why this issue is coming. How ever we resolved this issue by changing our html as mentioned below :-
<div id="owl-example" class="owl-carousel"><a href="#"> <span>DEF </span> </a></div>
Here we have replaced <span> with <div> tag inside <a> tag. We got some clue that <div> is not allowed inside <a> tag. But we would like to have <div> inside <a> tag as we have lots of html pages like this issue.
Can any one please help us as how to solve this issue?
We did some research and find some help like using "<validElements><![CDATA[*[*]]]></validElements>" in config/tinyMceConfig.config file but it didn't solve our problem.
Hi Tarunjit,
Try to see this similar post about allowing any elements in the RTE https://our.umbraco.org/forum/using/ui-questions/61290-Allowing-any-elements-in-the-RTE-in-V4118. This is a solution for Umbraco 4.11.8, but maybe you could use the same approach for Umbraco 7.2.1
Hope this helps,
/Dennis
The solution provided in the link referenced above does only allow for special attributes on image tags inserted, which was the issue Kim had.
Not sure how tidy is working and what it's looking at. And it should be disabled by default since the release of v4.9. So perhaps it's a bug...not sure.
But what are you scenarios for needing to put so much custom markup into the RTE field? Would'nt it be possible to use macroes instead? If you're doing caroussels etc. why don't keep the code in one maintainable place so it can easily be reused on other pages as well?
/Jan
And btw...please don't create multiple posts about the same subject :) You posted this yesterday, which is related to the same issue https://our.umbraco.org/forum/umbraco-7/using-umbraco-7/61735-Issue-While-Saving-HTML-Tags-In-Source-Code-Edtor
Please keep it in the same post - It makes it easier on yourself and others to see the suggestions given and what other issues might have arised since the original post etc :)
/Jan
Hi Jan,
Thanks for the answer.
Our scenario is a bit different we want Editors to create pages them seleves so in case if they use html like that which i have mentioned in my last comment then there could be issues. That's why i ask you about my problem.
I hope you understand my scenario. Please let me know if more elaboration is required.
If my requirement is clear to you then please let me know if you have the solution for the problem mentioned in my last comment?
Regards
Tarunjit Singh
Hi Tarunjit
I'm not sure I fully get your scenario - What is the reason that the client will need to add specific HTML themselves? Is it if they want to add a widget from a 3rd party service like flickr, Youtube or something like that? Or is it if they want to layout the whole page by themselves?
Another option could perhaps be to simply use a textbox multiple field?
/Jan
Hi All,
We have noticed that following tags are not supported in the Rich Text Box Editor (Tiny MCE Editor) while saving the html. After saving the html content which have these below mentioned tags we noticed that these tags got removed from the saved html.
<b>, <section>, <font>
Not sure why these tags are not getting supported.
Regards
Tarunjit Singh
Hi,
does anybody found a solution to this?
I have the same issue with Umbraco 7.2.5, we have html 5 templates and some of the content need to have html 5 tags.
But when we enter html code by clicking <> in RTE, it's get removed before we hit save and publish button.
I have posted the same question today, apologies for duplicating this question.
https://our.umbraco.org/forum/umbraco-7/using-umbraco-7/65134-Umbraco-7-allow-any-HTML-tag
Cheers,
Shuja
Hi,
Comment out
<validElements>
section in the /config/TidyMceConfig.config file and add this<validElements><![CDATA[*[*]]]></validElements>
Don't forgot to rebuild your solution.
Lokesh
Has anyone found a concrete solution to this common problem?
Solution suggested above by Lokesh : does not work for Umbraco 7.5.3.
My blog post will help you to do this. It lets you allow any markup inside the tiny mce editor http://www.codeshare.co.uk/blog/allow-any-markup-in-the-tinymce-editor/
Thank you Paul for your answer but this solution does not work for Umbraco 7.5.3. I 've been trying to include a div within a href:
and the RTE keeps on removing the href tag or applying it on each sub-element of div.
Hi Elias I just tried my article suggestion on 7.5.3 and it removed the a tag as you said.
Another way around this would be to create a macro. Add some properties to the macro for the link address, and the caption.
Then you could create the macro partial which renders the markup for the a tag how you need it, with the div inside.
Macros can be used in the rich text editor.
I hope this helps.
Paul
Thank you Paul, I will try the macro suggestion.
@Elias To allow a <div> inside an <a> within the rich text editor, add the following to tinyMceConfig.config in the <customConfig> section:
<config key="valid_children">+a[div]</config>
More information: https://www.tinymce.com/docs/configure/content-filtering/#valid_children
I am on Umbraco 7.11.1 and trying to enable schema markups in the RTE. I've tried all solutions mentioned here but none of them work. I was hopefully Paul's solution would do the trick but it didn't.
From reading the documents this
+div[*]
should work but it didn't.Have anyone gotten this to work on v7.11.1?
is working on a reply...