We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
  • I have searched and found some old posts for Evolution about this but is there anyway to set TinyMCE so that the user does not have to keep clicking "Paste as Plain" text over and over again (because it turns off automatically once a paste is completed). Clients find this extremely annoying.

    Found this: http://tracker.modx.com/issues/6880

    But not explanation about how to do it manually.
      • 33238
      • 388 Posts
      Hello man.

      Just go to PLUGINS and find the TinyMCE Rich Text Editor.
      click on it and go to the tab COFIGURATION.

      in the Plugin configuration Area, paste this lines:

      &paste_auto_cleanup_on_paste=Clean on Paste;list;true,false;true
      &paste_remove_styles=Remove Styles;list;true,false;true
      &paste_remove_styles_if_webkit=Remove Styles if Webkit;list;true,false;true
      &paste_strip_class_attributes=Paste Stip Class;list;true,false;true

      This are the lines in the link that you post, but includes the true false options.

      then click on Update parameters, and you will see the options at the button!

      i hope that works for you and for me, because the editor is so annoying including <spans and styles to the codes!

      Enjoy it! laugh
        • 36686
        • 165 Posts

        I can't find a configuration tab in MODx 2.2.6, but I did try adding Ysanmiguel's above suggestions under the Properties tab. I also tried adding them under System Settings in the format of "tiny.paste_auto_cleanup_on_paste" etc.

        Neither of the above worked unfortunately - I still get span tags and other junk when pasting in TinyMCE.

        Do you have a more detailed description of how to fix this?

        Many thanks!
          • 31566
          • 14 Posts
          Yes, I just hate TinyMCE too…
          I have the same issue: "Paste as Plain" is the only reliable way to add content by copy/paste.

          We need a proper way to add these settings ;-(
            • 5160
            • 118 Posts
            @sketchi - old thread I know but this might help:

            In TinyMCE (MODX plugin version 4.3.3-pl on Revolution 2.2.10-pl) pressing Ctrl + Shift + V pastes as plain text with no config changes.

            If you need two hands for that key combination, or your clients won't remember to do this, you can edit the plugin itself (one file) to set the default paste behaviour to be 'paste as plain text'. Edit:

            After line #124
            'use_browser' => $this->context->getOption('use_browser',true,$this->properties),

            'paste_text_sticky' => true, // Keeps Paste Text feature active until user deselects the Paste as Text button
            'paste_text_sticky_default' => true, // Makes the paste_text_sticky feature active when the editor loads
            'paste_auto_cleanup_on_paste'=> true, // If enabled contents will be automatically processed when you paste using Ctrl+V or similar methods. This is enabled by default.
            'paste_remove_styles'=> true, // If true, removes all style information when pasting, regardless of browser type. Pasting from Word 2000 will cause tinyMCE to error. Default is false.
            'paste_remove_styles_if_webkit'=> true, // If true, removes all style information when pasting in WebKit since it has a serious paste bug. Default is true.
            'paste_strip_class_attributes'=> 'all', // Enables you to strip the class attributes when pasted. Valid option values are "none", "all", and "mso". In the release 3.2.6 the default value was "all", in the current development version it is "mso".

            Plugin option descriptions in comments above are taken from the TinyMCE documentation:

            To allow these properties to be edited via MODX they need to be added as Properties to the TinyMCE plugin but these additions will not be automatically picked up as tinymce.class.php does not know they exist.

            They can be added by changing the code above to:
            'paste_text_sticky' => $this->context->getOption('tiny.paste_text_sticky','',$this->properties),

            But that's a whole bunch of work when you can just copy/paste the lines above.

            Note that updating the plugin in future will overwrite any changes made to tinymce.class.php but it's only a two minute job to make the same change to the new file. [ed. note: chris.dempsey78 last edited this post 10 years, 5 months ago.]
              • 36686
              • 165 Posts

              Thank you!!!!! This is a great solution for the time being, I'm gonna add this fix to all my sites from now on. It's gonna save both me and my clients so much hassle.

              Let's hope these properties are added to the TinyMCE addon in the next update.