We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 4429
    • 429 Posts
    I like to try and produce my sites to strict standard. However if content editors are using tinymce and say aligning images or text right/left etc.. I have noticed that tinymce drops CSS code into that page. surely that then turns the page into transitional and not strict.

    How can you devleop strict sites and have them edited in Modx?
      • 24495
      • 407 Posts
      surely that then turns the page into transitional and not strict
      Why? I developed strict sites with MODx. No problems with strict XHTML and TinyMCE at all. For my clients I delete all RTE buttons we don’t need (like aligning, font sizes and colors, ...). And they should use formatting with CSS classes via the format dropdown.
        • 36527
        • 120 Posts
        Would you be kind enough then to post your config exactly how you put into the Tiny configuration section in the plugin for others to learn from? Most of the issues come from innocuous br’s and not required extra paragraphs that tend to mess things up things in general.
          • 24495
          • 407 Posts
          There is no other configuration then the standard (with 0.9.6.3 final and the last TinyMCE version 3.2.1.1). The only one is setting entity encoding to raw because of using utf-8. All other things come directly from TinyMCE. No problems with unwanted br or paragraphs.

          For editors it’s required to paste text (if not written directly in the RTE) as plain text without formatting, breaks and paragraphs. And of course NOT directly from an MS Office application. And after pasting or writing text THEN you should set paragraphs and formats.

          It may be hard to understand that working with a CMS and a RTE should be learned like driving a car. You should have experience in traffic rules and in control a car. But operating MODx is a bit easier, like driving a dodgem car.  grin

          For my clients I suggest using Firefox as browser for editing content. Detecting empty (and unwanted) breaks and paragraphs I set up a RTE css file connected via the configuration. There are included some definitions for paragraphs, headings, lists and links to give the editior the "final" feeling of the text. And there are some additional definitions WORKING ONLY IN MODERN BROWSERS to detect paragraphs and headings:
          p:after, h1:after, h2:after, h3:after, h4:after {
          color:#990;
          background-color:#ff9;
          font-size:12px;
          font-style:normal;
          content:"\00B6\00A0";
          }

          Try this and you will see, and play around for your needs. Additionally you can see the effect from a live example (in German) with a customized RTE (deleted some buttons).
            • 36527
            • 120 Posts
            Thank you very much rasc - that is most kind of you to share smiley
              • 24495
              • 407 Posts
              It’s not a secret cool But you should use a browser understanding modern CSS like the ":after" pseudo-elements (e.g not an IE). And you should have the special css file for the editor connected in the tools -> configuration. Very helpful for editors to see the structure of the text.
                • 27708 MODX Staff
                • 2,502 Posts
                TinyMCE for some reason uses inline styles to align images. The version that Wordpress includes in its distros is a modified version that doesn’t have this problem. The Moxicode folks have balked at fixing this because they don’t think that their users are smart enough to deal with clearing the content following the images.

                What I did to workaround this (on a smallish site) was to create a plugin to replace all instances of the inline styles with a class.

                Another option is to create a short stylesheet that offers just the classes you want to offer for images and have that be the referenced stylesheet for TinyMCE.

                This is annoying to have to work around this. I don’t see why they don’t implement the fix/mod that exists in the WordPress version of TinyMCE.
                  Author of zero books. Formerly of many strange things. Pairs well with meats. Conversations are magical experiences. He's dangerous around code but a markup magician. Blog ✦ Twitter ✦ LinkedIn ✦ GitHub
                  • 24495
                  • 407 Posts
                  Another option is to create a short stylesheet that offers just the classes you want to offer for images and have that be the referenced stylesheet for TinyMCE.
                  Like said above: this is my option. Hiding/deleting the buttons for aligning elements and offering classes in the format dropdown.