Copied to clipboard

Flag this post as spam?

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


  • Thomas Beckert 193 posts 469 karma points
    Mar 23, 2022 @ 17:43
    Thomas Beckert
    0

    tinymce add i tag

    Hi. I try to allow an empty i tag (fontawesome) in tinymce RTE.

    I edited the appsettings-schema.json in line 3007, added the i-Tag on the ValidElements. I even tried [], but there seems no effect at all.

    Every time i restarted application pool and web as well.

    Any idea?

     "ValidElements": {
          "type": "string",
          "description": " ",
          "default": "+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],small[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[*],#i[class|style]"
        }
    
  • Huw Reddick 1929 posts 6677 karma points MVP 2x c-trib
    Mar 24, 2022 @ 08:45
    Huw Reddick
    0

    I don't think you should have a # in front of the i

  • Huw Reddick 1929 posts 6677 karma points MVP 2x c-trib
    Mar 24, 2022 @ 08:48
    Huw Reddick
    0

    also you need to change this (it removes i)

    -em/-i[class|style]

    to

    -em[class|style]

  • Thomas Beckert 193 posts 469 karma points
    Mar 24, 2022 @ 08:57
    Thomas Beckert
    0

    I changed as you proposed, but it still removes the i-Tag in my RTE. :(

  • Huw Reddick 1929 posts 6677 karma points MVP 2x c-trib
    Mar 24, 2022 @ 09:01
    Huw Reddick
    0

    I will test in my v9 later and let you know how I get on, but that certainly works in v8

  • Thomas Beckert 193 posts 469 karma points
    Mar 24, 2022 @ 09:03
    Thomas Beckert
    0

    Yes. In v8 I never had this kind of problems. :)

    For for the protocol: i did the changes in this file:

    ./umbraco/config/appsettings-schema.json

    Thanks for your support!

  • Huw Reddick 1929 posts 6677 karma points MVP 2x c-trib
    Mar 24, 2022 @ 09:10
    Huw Reddick
    0

    I think your declaration is incorrect, I think you should be doing this

      "RichTextEditor": {
        "ValidElements": "+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[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],small[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[*],i[class|style]"
      }
    
  • Thomas Beckert 193 posts 469 karma points
    Mar 24, 2022 @ 09:16
    Thomas Beckert
    0

    The configuration happens in this block:

    "UmbracoCmsCoreConfigurationModelsRichTextEditorSettings": {
      "type": "object",
      "properties": {
        "Commands": {
          "type": "array",
          "description": "HTML RichText Editor TinyMCE Commands",
          "items": {
            "$ref": "#/definitions/UmbracoCmsCoreConfigurationModelsRichTextEditorCommand"
          }
        },
        "Plugins": {
          "type": "array",
          "description": "HTML RichText Editor TinyMCE Plugins",
          "items": {
            "type": "string"
          }
        },
        "CustomConfig": {
          "type": "object",
          "description": "HTML RichText Editor TinyMCE Custom Config",
          "additionalProperties": {
            "type": "string"
          }
        },
        "ValidElements": {
          "type": "string",
          "description": " ",
          "default": "+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[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],small[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[*],i[class|style]"
        },
        "InvalidElements": {
          "type": "string",
          "description": "Invalid HTML elements for RichText Editor",
          "default": "font"
        }
      }
    },
    
  • Huw Reddick 1929 posts 6677 karma points MVP 2x c-trib
    Mar 24, 2022 @ 10:35
    Huw Reddick
    0

    I just installed latest v9.4.0 and tried it, doesn't appear to work as you have discovered.

  • Huw Reddick 1929 posts 6677 karma points MVP 2x c-trib
    Mar 24, 2022 @ 10:41
    Huw Reddick
    0

    on further checking, perhaps this is not the place for this, I noticed that every time I run the website in Visual studio the appsettings-schema.json gets over written removing my changes.

  • Thomas Beckert 193 posts 469 karma points
    Mar 24, 2022 @ 10:47
    Thomas Beckert
    0

    Yes, I noticed that too. So I did my changes on the deployed version on our server. Restarting the web to take effect of the changes. But it did not work either.

  • Huw Reddick 1929 posts 6677 karma points MVP 2x c-trib
    Mar 24, 2022 @ 11:03
    Huw Reddick
    101

    You need to add it to appsettings.json in your site root like below

      "Umbraco": {
    "CMS": {
      "Hosting": {
        "Debug": false
      },
      "Content": {
        "ContentVersionCleanupPolicy": {
          "EnableCleanup": true
        }
      },
      "Global": {
        "Id": "bd45c30f-b451-4cfb-834e-22410a3f2537"
      },
      "RichTextEditor": {
        "ValidElements": "+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],i[class|style],-strong/-b[class|style],-em[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],small[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[*],figure,figcaption"
      }
    }
    

    }

    I just test and that works fine

  • Thomas Beckert 193 posts 469 karma points
    Mar 24, 2022 @ 14:35
    Thomas Beckert
    0

    You hit it! Thanks a lot!

  • Huw Reddick 1929 posts 6677 karma points MVP 2x c-trib
    Mar 24, 2022 @ 15:32
    Huw Reddick
    0

    Glad I could help

Please Sign in or register to post replies

Write your reply to:

Draft