Copied to clipboard

Flag this post as spam?

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


  • Lance Taylor 11 posts 83 karma points
    Mar 01, 2021 @ 16:10
    Lance Taylor
    0

    RTE in grid adding HTML and HEAD tags

    Hello all,

    Been dealing with a very odd problem that I have chased down to the RTE. The raw HTML view shows the RTE is adding , and

        <!DOCTYPE html>
    <html>
    <head>
    </head>
    <body>
    
    </body>
    </html>
    

    This is causing some issues with the page ultimately breaking the DOM due to the HTML being malformed when these are nested within a grid.

    The solution is simple to just remove these tags however I cannot seem to find the base html that the rte uses to build itself. Or if it is the tinyMceConfig. I cannot figure out how to change that to strip these tags.

    Anyone able to direct me to where I should look?

  • Huw Reddick 1929 posts 6717 karma points MVP 2x c-trib
    Mar 01, 2021 @ 17:34
    Huw Reddick
    0

    I believe it is in Views\Partials\Grid\editors but pretty sure it doesn't add HTML and head tags normally, certainly not in my experience, what is the exact version of Umbraco you are using?

  • Lance Taylor 11 posts 83 karma points
    Mar 01, 2021 @ 17:43
    Lance Taylor
    0

    I am just using Umbraco 8. I haven't messed with the RTE and used the demo / intro site as a back bone. But if you look at the source code directly by clicking on the RTE and the left most button is the view source code. You can see the tags are added by default. This wouldn't be an issue normally but another 3rd party system I have to use the site with is breaking the DOM because of these tags.

    I tried adding them to the invalid tags part of the tinymceconfig.config. This does not seem to have changed it either as the tags are still there.

  • Huw Reddick 1929 posts 6717 karma points MVP 2x c-trib
    Mar 01, 2021 @ 17:48
    Huw Reddick
    0

    don't suppose you have a url we can look at?

  • Lance Taylor 11 posts 83 karma points
    Mar 01, 2021 @ 18:00
    Lance Taylor
    0

    No URL. I will show you the screenshots if you would like. I will attach them to this convo. However I have confirmed you get the same result by just making a brand new Sln and using Umbraco 8 with it. All RTE fields will by default have these tags and you cannot remove them as they will immediately be added back by Umbraco.

  • Lance Taylor 11 posts 83 karma points
    Mar 01, 2021 @ 18:01
    Lance Taylor
    0

    Brand new RTE field

  • Lance Taylor 11 posts 83 karma points
    Mar 01, 2021 @ 18:01
    Lance Taylor
    0

    Generated SC for fresh RTE field

  • Lance Taylor 11 posts 83 karma points
    Mar 01, 2021 @ 18:03
    Lance Taylor
    0

    I have added the screenshots. If you would like to test it yourself and see if it is giving you something different please do and let me know. As far as I can tell this is something they have either allowed the tinymce to do which is not great as it results in malformed html. Or umbraco itself is doing it which is also not great.

  • Huw Reddick 1929 posts 6717 karma points MVP 2x c-trib
    Mar 01, 2021 @ 18:38
    Huw Reddick
    0

    Very odd, I get a completely empty window no code in it at all.

  • Lance Taylor 11 posts 83 karma points
    Mar 01, 2021 @ 18:56
    Lance Taylor
    1

    I have fixed it.

    For anyone in the future who is dealing with this.

    1) Go into the tinymceconfig.config.

    2) There is a plugin called fullpage you can find under the <plugins>

    3) Remove the line <plugin>fullpage</plugin>

    4) Hard force the ClientDependency.config file to reload the tinymce settings this is done by changing the value at

    5) Reboot your sln ctrl + F5. Go into the back office and go to each RTE editor. Open the Source Code viewer you should no longer see the html, head and body tags.

    6) Change nothing and click submit.

    7) Republish

  • Huw Reddick 1929 posts 6717 karma points MVP 2x c-trib
    Mar 01, 2021 @ 20:17
    Huw Reddick
    0

    Good find.

  • Bishwajit 28 posts 98 karma points
    Jul 21, 2023 @ 10:08
    Bishwajit
    0

    I have included gridComponent property in RTE, but it is not loading dialogue box of edit item and displaying blank window. Same code is working fine in umbraco-7 but after migration into 8 its not working any more. Please help.

    enter image description here

Please Sign in or register to post replies

Write your reply to:

Draft