Copied to clipboard

Flag this post as spam?

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


  • Tom Jones 19 posts 150 karma points
    Jun 11, 2023 @ 19:44
    Tom Jones
    0

    Rich text editor config changes in appsettings don't work

    Hi folks, I'm struggling to configure the TinyMCE RTE in the Umbraco appsettings.json file - the documentation is poor and often just references the TinyMCE documentation (which expects RTEs to be instantiated using JavaScript), and the config changes I was able to eventually find don't seem to make any difference when I run the app.

    A few examples I've tried by adding under the Umbraco:CMS:RichTextEditor node:

    "ValidElements": "-blockquote[dir|style|class]"
    

    No block quote option is available in the RTE config.

    "CustomConfig": {
              "table_default_attributes": "{\"class\": \"table\"}",
              "table_default_styles": "{}"
            }
    

    Tables still have default styling and don't have the table class applied.

    "Plugins": [ "advcode" ]
    

    No code formatting options are available in the RTE config, additionally the "Plugins" node is described in the documentation as expecting an array of strings, but the appsettings schema dictates that this should in fact be a string - and neither options seem to work when trying to add "advcode" (advanced code) plugin.

    I've also tried adding to the development version as well just in case there was something weird happening there since I'm testing this locally first.

    Someone else posted a while ago regarding the table config, and said that it just eventually worked so might have been a caching problem, but other settings changes I make are applied immediately.

    Any ideas?

  • Huw Reddick 1929 posts 6697 karma points MVP 2x c-trib
    Jun 11, 2023 @ 20:09
  • Tom Jones 19 posts 150 karma points
    Jun 11, 2023 @ 20:59
    Tom Jones
    0

    Yes, thank you! Why the hell couldn't I find this syntax anywhere?!

    The table class still doesn't seem to work unfortunately, any ideas what's wrong with that bit of config? I tried a few variations of array/object strings but neither seemed to work.

  • Huw Reddick 1929 posts 6697 karma points MVP 2x c-trib
    Jun 12, 2023 @ 08:05
    Huw Reddick
    0

    did you add "table" to the plugins array?

    not sure about the custom_config bit, I will have a play on mine..

  • Huw Reddick 1929 posts 6697 karma points MVP 2x c-trib
    Jun 12, 2023 @ 08:15
    Huw Reddick
    0

    Your custom config worked OK for me,

    This is the table it added

    <table border="0" class="table">
    <tbody>
    <tr>
    <td> </td>
    <td> </td>
    </tr>
    <tr>
    <td> </td>
    <td> </td>
    </tr>
    </tbody>
    </table>
    
  • Tom Jones 19 posts 150 karma points
    Jun 13, 2023 @ 18:46
    Tom Jones
    0

    It worked, I realised that it only seems to apply to newly-created tables.

    Thanks again!

Please Sign in or register to post replies

Write your reply to:

Draft