We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 36786 ☆ A M B ☆
    • 209 Posts
    Is there a way to disable the setting for TinyMCE of "valid_elements" so that I no longer have to deal with it removing my content? I'm not sure where that setting would be in the component files and it isn't part of the system settings.

    I also need to get it to stop turning < i > tags into < em > tags for Font-Awesome.

    Thanks! [ed. note: maroonlover last edited this post 12 years, 6 months ago.]
      Ben Morrison
      Hacking templates to pieces since 2003
      • 36786 ☆ A M B ☆
      • 209 Posts
      In fact, could I just disable any and ALL tag filtering? Even empty tags? I manage this website myself so it is only an annoyance. i tried this in the xconfig.js file but to no avail. I got this from http://stackoverflow.com/questions/6266487/tinymce-allow-all-html-tag

      var valid_elements : '+*[*]',
      var tinymce_extended_valid_elements = "";
      var tinymce_invalid_elements = "";


      and

      var valid_elements : '+*[*]',
      var tinymce_extended_valid_elements = "";
      var tinymce_invalid_elements = "";


      Yes I did clear my browser and Modx cache.
        Ben Morrison
        Hacking templates to pieces since 2003
        • 42562
        • 1,145 Posts
        I suspect that the file you are editing, is just taking the contents of your var and ADDING (instead of replacing) them to existing valid_elements.
        In vanilla TinyMCE, it's so easy to fix your problem, as you saw in the stackoverflow post.

        Find the TinyMCE configuration that this file (if not itself) is feeding, and edit accordingly.

        To fix <i>/<em> conversion, look for this code and fix it.
        valid_elements: "i/em";
          TinymceWrapper: Complete back/frontend content solution.
          Harden your MODX site by passwording your three main folders: core, manager, connectors and renaming your assets (thank me later!)
          5 ways to sniff / hack your own sites; even with renamed/hidden folders, burst them all up, to see how secure you are not.
          • 36786 ☆ A M B ☆
          • 209 Posts
          I tried to change it to the following as was suggested on Stack Overflow. with no result:

          valid_elements: "em,i";


          Could it be the xconfig.js file is being overwritten?
            Ben Morrison
            Hacking templates to pieces since 2003
            • 42562
            • 1,145 Posts
            Note the latest version of MODx' TinyMCE is outdated. See its changelog: Update TinyMCE to 3.5.4.1

            Whereas the latest official TinyMCE is 4.0.22 or so.

            Nonetheless, I think this instance of code is still valid in the MODx version.
            valid_elements: "em/i";
            // slash instead of comma


            Which version are you using?

            Your problem is probably, duplication of code somewhere.
            I just checked this xconfig file in question, and I saw under valid_elements
            +'em/i[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress'


            Once again, what version are you using?
              TinymceWrapper: Complete back/frontend content solution.
              Harden your MODX site by passwording your three main folders: core, manager, connectors and renaming your assets (thank me later!)
              5 ways to sniff / hack your own sites; even with renamed/hidden folders, burst them all up, to see how secure you are not.
              • 36786 ☆ A M B ☆
              • 209 Posts
              I am using version 4.3.3 and the slash is what was originally in the file and those on Stack Overflow said to replace with a comma. So I am getting conflicting messages all over the place, but I think you are right some of the information I find online is from out of date sources. Really I have no idea what is going on, but it seems that some code is overriding the xconfig.js file.
                Ben Morrison
                Hacking templates to pieces since 2003
                • 42562
                • 1,145 Posts
                Upgrade to TinymceWrapper; solve all your past, present and future problems
                  TinymceWrapper: Complete back/frontend content solution.
                  Harden your MODX site by passwording your three main folders: core, manager, connectors and renaming your assets (thank me later!)
                  5 ways to sniff / hack your own sites; even with renamed/hidden folders, burst them all up, to see how secure you are not.