Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Tarunjit 103 posts 146 karma points
    Feb 27, 2015 @ 07:46
    Tarunjit
    1

    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.

     

  • Dennis Aaen 4499 posts 18254 karma points admin hq c-trib
    Feb 27, 2015 @ 08:15
    Dennis Aaen
    0

    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

  • Jan Skovgaard 11280 posts 23678 karma points MVP 10x admin c-trib
    Feb 27, 2015 @ 09:07
    Jan Skovgaard
    0

    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

  • Jan Skovgaard 11280 posts 23678 karma points MVP 10x admin c-trib
    Feb 27, 2015 @ 09:11
    Jan Skovgaard
    0

    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

  • Tarunjit 103 posts 146 karma points
    Feb 27, 2015 @ 11:35
    Tarunjit
    0

    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

     

     

  • Jan Skovgaard 11280 posts 23678 karma points MVP 10x admin c-trib
    Feb 27, 2015 @ 21:00
    Jan Skovgaard
    0

    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

  • Tarunjit 103 posts 146 karma points
    Mar 03, 2015 @ 12:53
    Tarunjit
    0

    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

  • Shuja Siddiqui 7 posts 73 karma points
    May 28, 2015 @ 02:42
    Shuja Siddiqui
    0

    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

  • Lokesh kumar Chippada 44 posts 249 karma points
    Mar 09, 2016 @ 15:09
    Lokesh kumar Chippada
    1

    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

  • Elias 7 posts 78 karma points
    Oct 21, 2016 @ 15:52
    Elias
    0

    Has anyone found a concrete solution to this common problem?

    Solution suggested above by Lokesh : does not work for Umbraco 7.5.3.

  • Paul Seal 524 posts 2889 karma points MVP 6x c-trib
    Oct 22, 2016 @ 07:51
    Paul Seal
    0

    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/

  • Elias 7 posts 78 karma points
    Oct 24, 2016 @ 09:13
    Elias
    0

    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:

    <a ....>
    <div> ... </div>
    </a> 
    

    and the RTE keeps on removing the href tag or applying it on each sub-element of div.

  • Paul Seal 524 posts 2889 karma points MVP 6x c-trib
    Oct 24, 2016 @ 09:44
    Paul Seal
    0

    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

  • Elias 7 posts 78 karma points
    Oct 24, 2016 @ 09:47
    Elias
    0

    Thank you Paul, I will try the macro suggestion.

  • Ed Salwin 8 posts 72 karma points
    Dec 13, 2016 @ 17:22
    Ed Salwin
    0

    @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

  • Kong Yang 15 posts 103 karma points
    Mar 10, 2020 @ 23:01
    Kong Yang
    0

    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?

Please Sign in or register to post replies

Write your reply to:

Draft