Copied to clipboard

Flag this post as spam?

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


  • Paul 184 posts 646 karma points
    May 13, 2016 @ 10:29
    Paul
    0

    TinyMCE and Font-Awesome

    Hi All,

    I'm trying to use Font-Awesome in Umbraco 7. The problem I'm encountering is that whenever I add some typical font-awesome code in the RTE it gets stripped out thanks to TinyMCE trying to clean the code up. E.g. adding in

    <i class="fa fa-search" aria-hidden="true"></i><h2>heading</h2>
    

    I've tried all kinds of different settings in the tinyMceConfig.config file, and the best I can get is a result of

    <p><i class="fa fa-search" aria-hidden="true">&nbsp;</i></p>h2>heading</h2><p>
    

    That was with adding #i to the tinyMceConfig.config. Most other things I tried resulted in the likes of just <h2>heading</h2> coming back or worse <p><h2>heading</h2></p>

    I noticed that in TinyMCE you can use "extendedvalidelements" but I'm unsure how that could be added to the tinyMceConfig.config in order to allow me to use that.

    If anyone knows how to allow certain empty tags and not have TinyMCE putting tags round them or stripping things out I'd really appreciate it. I've looked at lots of posts on here about it, but all I could find were posts about disabling all of the HTML markup tidying stuff, I just want tags to be ignored by it.

    Thanks in anticipation.

  • Matthew Kirschner 323 posts 611 karma points
    Nov 28, 2016 @ 18:27
    Matthew Kirschner
    102

    This link is relevant to your interests: https://www.gajadigital.com/en/blog/2016/january/how-to-make-plugins-work-for-rte-in-umbraco-7/

    To enable empty <i> tags in the RTE, the CDATA in your <validElements> tag in /Config/tinyMceConfig.config should like this (changes noted in bold):

    +a[id|style|rel|data-id|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[class|style],+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[*]

  • Paul 184 posts 646 karma points
    Dec 07, 2016 @ 15:14
    Paul
    0

    Thanks for the reply Matthew, it's very much appreciated!

  • Bradford Ewing 2 posts 72 karma points
    Nov 01, 2020 @ 14:35
    Bradford Ewing
    0

    Thank you Matthew! This solution really helped me!!

Please Sign in or register to post replies

Write your reply to:

Draft