Copied to clipboard

Flag this post as spam?

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


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

    CustomConfig Umbraco 11

    Has anyone had any luck getting CustomConfig to work with TinyMCE 6/Umbraco 11?

    I'm trying to add some custom style menus using "style_formats" but they just don't work.

       "CMS": {
          "Content": {
            "MacroErrors": "Throw",
            "Error404Collection": [
              {
                "Culture": "default",
                "ContentKey": "f7d4c0c8-7b6a-4d30-b7aa-e0fac492bdb9"
              }
            ]
          },
          "Hosting": {
            "Debug": true
          },
          "Runtime": {
            "Mode": "BackofficeDevelopment",
            "MaxQueryStringLength": 900,
            "MaxRequestLength": 2000000
          },
          "ModelsBuilder": {
            "ModelsMode": "SourceCodeManual",
            "ModelsNamespace": "Lcp.Core.Features.Shared.ModelsBuilder",
            "FlagOutOfDateModels": true,
            "ModelsDirectory": "~/../Lcp.Core/Features/Shared/ModelsBuilder",
            "AcceptUnsafeModelsDirectory": true
          },
          "RuntimeMinification": {
            "UseInMemoryCache": true,
            "CacheBuster": "Timestamp"
          },
          "RichTextEditor": {
            "InvalidElements": "font, span, div, br",
            "CustomConfig": {
              "entity_encoding": "raw",
              "paste_remove_styles_if_webkit": "true",
              "paste_as_text": "true",
              "style_formats": "{\"title\":\"Table\",\"items\":[{\"title\":\"Data table\",\"selector\": \"table\",\"classes\": \"table-scroller\"}]},{\"title\": \"Image\",\"items\":[{\"title\":\"Zoom Magnifier\",\"selector\":\"img\",\"classes\":\"zoom\"}]},{\"title\":\"Paragraph\",\"items\":[{\"title\":\"Emphasis\",\"selector\":\"p\",\"classes\":\"medium\"},{\"title\":\"Introduction\",\"selector\":\"p\",\"classes\":\"large\"}]}"
            }
          }
    
  • Huw Reddick 1929 posts 6717 karma points MVP 2x c-trib
    Sep 01, 2023 @ 09:05
    Huw Reddick
    0

    yes, it works fine, which bit isn't working for you?

    I can see that your style_formats is not correct. it should start and end with square brackets [ ...... ]

  • drummerboy46 27 posts 89 karma points
    Sep 01, 2023 @ 09:15
    drummerboy46
    0

    Wow so this is a new one for me! I've always been able, pretty sure even in Umbraco 9 to use "style_formats" in combination with embedded stylesheets in the RTE. As soon as I turn on my stylesheet the additional formats stop working (see s/s below)

    enter image description here

    enter image description here

    With style_formats (turned off stylesheet)

    enter image description here

  • Luuk Peters 85 posts 331 karma points
    Sep 01, 2023 @ 09:48
    Luuk Peters
    0

    A quick tip: always throw your configuration into a JSON validator if something doesn't work. This way you can at least fix any formatting errors if they exist. Your provided example has JSON formatting errors.

  • drummerboy46 27 posts 89 karma points
    Sep 01, 2023 @ 10:03
    drummerboy46
    100

    I found a work around, I had 3 styles set in the backoffice stylesheet that I just added to "style_formats" entries and removed them from the stylesheet.

    So from what I can tell you can no longer use together umb_name and style_formats

    umb_name will now override

Please Sign in or register to post replies

Write your reply to:

Draft