Copied to clipboard

Flag this post as spam?

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


  • Martin Griffiths 826 posts 1269 karma points c-trib
    Apr 22, 2021 @ 09:59
    Martin Griffiths
    0

    Does anyone know if Umbraco will read all possible TinyMCE configuration options?

    I've have "style_formats" working fine. But I want to override the buttons (left, center, right for example) so that only styles are applied and NOT inline style. This can only be done using the "formats" option in TinyMCE, but Umbraco doesnt seem to be paying attention to this.

    Code below...

     <config key="formats">
      [{
        "aligncenter": [{ 
          "selector": "p", 
          "classes": "center-text" 
        }]
      }]
    </config>
    <config key="style_formats">
      [{
      "title": "Image",
      "items": [{
        "title": "Float Left Image",
        "selector": "img",
        "classes": "formatted-textbox__float-left"
        },
        {
        "title": "Float Right Image",
        "selector": "img",
        "classes": "formatted-textbox__float-right"
        },
        {
        "title": "Zoom",
        "selector": "img",
        "classes": "zoom"
        }]
      },
      {
      "title": "Emphasis",
      "selector": "p",
      "classes": "medium"
      },
      {
      "title": "Introduction",
      "selector": "p",
      "classes": "large"
      }]
    </config>
    
  • Huw Reddick 1737 posts 6098 karma points MVP c-trib
    Apr 22, 2021 @ 21:29
    Huw Reddick
    0

    Hi Martin,

    You don't need the square [] for formats option, just do this

    <config key="formats">
          {
              "aligncenter": { 
              "selector": "p", 
              "classes": "center-text" 
              },
              "alignleft": { 
              "selector": "p", 
              "classes": "text-left" 
              }
          }
    </config>
    
  • Martin Griffiths 826 posts 1269 karma points c-trib
    Apr 27, 2021 @ 17:47
    Martin Griffiths
    0

    Hi Huw

    Yip thanks, did the trick!

    Martin

Please Sign in or register to post replies

Write your reply to:

Draft