Copied to clipboard

Flag this post as spam?

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


  • mizzle 90 posts 325 karma points
    Apr 07, 2023 @ 19:35
    mizzle
    0

    Adding styles to RTE Style Dropdown in Umbraco 11

    In Umbraco 8, I would add styles to the RTE via tinyMceConfig.config settings because it would allow a more organized dropdown than simply adding a stylesheet, and I could adjust whether the styles would apply to spans, paragraphs, etc.

    I tried following this resource for changing RTE settings, but it doesn't appear to have any effect on my RTE and the dropdown remains unchanged. Is there something I'm missing, or something that the instruction left out Does some cache somewhere need refreshing or do I need to do something to the site itself for the changes to appear?

  • Huw Reddick 1929 posts 6717 karma points MVP 2x c-trib
    Apr 08, 2023 @ 08:08
    Huw Reddick
    0

    It should work fine OOTB, you can check out my blog post on an easier way to do any updates without having to wory about escaping your settings for the style_formats section

    https://umbraco.themediawizards.co.uk/the-grimoire/formatting-for-richtexteditor-config/

  • mizzle 90 posts 325 karma points
    Apr 11, 2023 @ 13:51
    mizzle
    0

    I think that would be helpful as a second step after getting the styles to show in the dropdown, but currently I can't even get that to happen.

    I'm copying and pasting the style_formats as they appear in the linked resource but there is never any change to my RTE.

  • Huw Reddick 1929 posts 6717 karma points MVP 2x c-trib
    Apr 11, 2023 @ 16:15
    Huw Reddick
    100

    The only thing I can suggest is that maybe something in your style_formats string is not correct so it is not parsing correctly.

    What version of Umbraco are you using, I will fire up the same version to check, but not had any problems in 9/10 or 11 so far.

  • drummerboy46 27 posts 89 karma points
    Sep 01, 2023 @ 08:51
    drummerboy46
    0

    Hey Huw

    I can't get even the most simple of "style_formats" to work in Umbraco 11. Can you offer any advice?

      "RichTextEditor": {
        "CustomConfig": {
          "style_formats": "[{\"title\": \"Red text\",\"inline\": \"span\",\"classes\": \"red\"}]"
        }
      }
    
  • Huw Reddick 1929 posts 6717 karma points MVP 2x c-trib
    Sep 01, 2023 @ 09:03
    Huw Reddick
    0

    doesn't look like your declaration is quite right, it should be something like below

    "[{\"title\": \"Custom Stuff\",\"items\": [{\"title\": \"Red text\",\"inline\":\"span\",\"attributes\": {\"class\": \"red\"]}]"
    
Please Sign in or register to post replies

Write your reply to:

Draft