Copied to clipboard

Flag this post as spam?

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


  • Danine Noble 82 posts 368 karma points
    Jan 02, 2024 @ 22:58
    Danine Noble
    0

    Custom RTE Style Groups

    Y'know how the default Styles dropdown in the Rich Text Editor looks with the Headers, Blocks, and Containers categories?

    How do you accomplish that with a custom rich text style sheet?

    There doesn't appear to be any options for grouping sets of styles like this in the editor and no instructions in the documentation for it. Whatever you add for to a styles just gets all dumped into a single one-level list.

    Is it possible to do OOTB?

    (Workin' in v12/v13)


    Edit: Just found the rte appsettings. But it looks like it's all hardcoded options. Is there a way to have it pull from values setup in a style sheet?

  • Marc Goodson 2155 posts 14408 karma points MVP 9x c-trib
    Jan 03, 2024 @ 13:00
    Marc Goodson
    100

    Hi Danine

    Basically, the stylesheet approach is how historically Umbraco originally did it to add basic options to the style dropdown for the rich text editor, based on the picked css file, which is quite neat, and you can have different style options for each Rich Text Editor.

    Whereas the appsettings approach sidesteps Umbraco completely and works directly with TinyMCE's configuration, this gives you much much more flexibility as TinyMCE has some quite rich configuration options, eg only allow a css class to be applied to a heading element etc, or as you've noticed grouping of the style options. The downside is that one set of configuration applies to all Rich Text Editor instances on the site, which is not so flexible!

    But in answer to your question there isn't currently a way to specify comments or markup in the css file that would enable options to be grouped in the way that you can achieve via appsettings :-(

    There have been a few discussions over the years, but agree it would be great to at least do folder grouping of styles somehow outside of the global appsettings:

    https://github.com/umbraco/Umbraco-CMS/discussions/12435 https://github.com/umbraco/Umbraco-CMS/discussions/14632

    regards

    marc

  • Danine Noble 82 posts 368 karma points
    Jan 03, 2024 @ 17:38
    Danine Noble
    0

    Aw dang, well! Glad it's being talked about :D Will keep tabs on it, thank you Marc! <3

Please Sign in or register to post replies

Write your reply to:

Draft