Copied to clipboard

Flag this post as spam?

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


  • Nicholas Westby 2054 posts 7100 karma points c-trib
    Aug 03, 2017 @ 21:36
    Nicholas Westby
    0

    Some Formats in TinyMCE Drop Down are Disabled

    I was having trouble adding custom icons to the TinyMCE toolbar (that's another story for another day), so I thought I'd try adding items to TinyMCE's "Formats" drop down. However, I seem to be running into some issues:

    Disabled Formats

    As you can see, two of the three "Uncommon" formats are disabled (namely, abbreviation and quote). The HTML elements these correspond to are "abbr" and "q". The HTML element for "Sample Output" is "samp". Here's how I configured these in my tinyMceConfig.config:

    <config key="style_formats">[
      {
        "title": "Headers",
        "items": [
          {"title": "Largest", "format": "h2"},
          {"title": "Large", "format": "h3"},
          {"title": "Medium", "format": "h4"},
          {"title": "Small", "format": "h5"},
          {"title": "Smallest", "format": "h6"}
        ]
      },
      {
        "title": "Uncommon",
        "items": [
          {"title": "Abbreviation", "format": "abbr"},
          {"title": "Quote", "format": "q"},
          {"title": "Sample Output", "format": "samp"}
        ]
      }
    ]</config>
    

    In that same file, I have also indicated that all three are valid elements (near the bottom of the list):

      <validElements>
        <![CDA TA[+a[id|style|rel|data-id|data-udi|rev|charset|hreflang|dir|lang|tabindex|accesskey|type|name|href|target|title|class|onfocus|onblur|onclick|
    ondblclick|onmousedown|onmouseup|onmouseover|onmousemove|onmouseout|onkeypress|onkeydown|onkeyup],-strong/-b[class|style],-em/-i[class|style],
    -strike[class|style],-u[class|style],#p[id|style|dir|class|align],-ol[class|reversed|start|style|type],-ul[class|style],-li[class|style],br[class],
    img[id|dir|lang|longdesc|usemap|style|class|src|onmouseover|onmouseout|border|alt=|title|hspace|vspace|width|height|align|umbracoorgwidth|umbracoorgheight|onresize|onresizestart|onresizeend|rel|data-id],
    -sub[style|class],-sup[style|class],-blockquote[dir|style|class],-table[border=0|cellspacing|cellpadding|width|height|class|align|summary|style|dir|id|lang|bgcolor|background|bordercolor],
    -tr[id|lang|dir|class|rowspan|width|height|align|valign|style|bgcolor|background|bordercolor],tbody[id|class],
    thead[id|class],tfoot[id|class],#td[id|lang|dir|class|colspan|rowspan|width|height|align|valign|style|bgcolor|background|bordercolor|scope],
    -th[id|lang|dir|class|colspan|rowspan|width|height|align|valign|style|scope],caption[id|lang|dir|class|style],-div[id|dir|class|align|style],
    -span[class|align|style],-pre[class|align|style],address[class|align|style],-h1[id|dir|class|align|style],-h2[id|dir|class|align|style],
    -h3[id|dir|class|align|style],-h4[id|dir|class|align|style],-h5[id|dir|class|align|style],-h6[id|style|dir|class|align|style],hr[class|style],
    dd[id|class|title|style|dir|lang],dl[id|class|title|style|dir|lang],dt[id|class|title|style|dir|lang],object[class|id|width|height|codebase|*],
    param[name|value|_value|class],embed[type|width|height|src|class|*],map[name|class],area[shape|coords|href|alt|target|class],bdo[class],button[class],iframe[*],
    abbr[title|class],q[*],samp[*]]]>
      </validElements>
    

    FYI, I tossed a space in that CDATA element just for the code snippet here (I know of an outstanding Umbraco bug relating to CDATA, so thought I'd avoid that). In the real code, there is no space.

    I have no idea why all of the formats work except for "abbr" and "q". Any ideas?

  • Elin 45 posts 166 karma points
    Sep 28, 2017 @ 15:17
    Elin
    0

    Hi Nicholas,

    did you ever got this working by any chance, I'm ahaving the exact same issue.

    Thank you.

  • Nicholas Westby 2054 posts 7100 karma points c-trib
    Sep 28, 2017 @ 17:38
    Nicholas Westby
    0

    Nope, still doesn't work as far as I know. If you ever get this working, I'd also like to know how.

  • Nicholas Westby 2054 posts 7100 karma points c-trib
    Sep 28, 2017 @ 17:44
    Nicholas Westby
    0

    Looks like there is an upcoming change to update to a newer version of TinyMCE: http://issues.umbraco.org/issue/U4-10191

    Perhaps this issue will go away then (or maybe not).

Please Sign in or register to post replies

Write your reply to:

Draft