We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 32507
    • 142 Posts
    Actually Redactor modifies the code more than TinyMCE.

    Sometimes I simply have to add some "extra" code to RTE. i find it very frustrating and slow to "chunkify" every little piece code so RTE doesn't mess it up. For example if i wan't to add bootstrap div-clearfix element, i must add it with Chunk (except with TinyMCE). And also end-users will see Chunk tags in RTE, which is not user friendly.

    I can work without RTE, but the end users can't. So usually resources has to be in rich text-mode.

    I haven't found any better solution for this RTE vs Code problem.
      • 18373 ☆ A M B ☆
      • 3,141 Posts
      I honestly haven't worked enough with TinyMCE in the past few years to make an educated statement on whether or not it's true that Redactor does more than TinyMCE (also, which of the 3? tongue), but there is no denying that Redactor attempts to clean up the markup. I'd say Redactor is definitely more opinionated in what it does and doesn't do, so it's probably true.

      The cleanup doesn't always work the way people want it to: we see support questions both about it doing too much, and too little. There's a lot of possible configuration, also related to cleanup and tags, but it's not always clear what affects what, which is one of the things we're keeping in mind for v3.

      While I'm not trying to turn this into a ContentBlocks sales pitch, that is in fact approach I would recommend for mixing rich content, and more complex pieces of markup. It has dedicated input fields, each with their own markup that you can define. That would be total overkill for just adding a clearfix element into content, but it might help you answer the question if the content is the right place for a clearfix, instead of for example a section-level element that your content is wrapped by. Food for thought.
        Mark Hamstra • Developer spending his days working on Premium Extras and a MODX Site Dashboard with the ability to remotely upgrade MODX and extras to make the MODX world a little better.

        Tweet me @mark_hamstra, check my infrequent blog at markhamstra.com, my slightly more frequent ramblings at MODX.today or see code at Github.
        • 32507
        • 142 Posts
        Quote from: markh at Oct 27, 2016, 05:35 AM
        That would be total overkill for just adding a clearfix element into content, but it might help you answer the question if the content is the right place for a clearfix, instead of for example a section-level element that your content is wrapped by. Food for thought.

        So basically Content field can contain only "raw" text and images? And everything what even slighest effects to layout, should be in template.
        Only solution is to break my content field into multiple Richtext TVs. Even i need just clearfix-div?
          • 42042
          • 140 Posts
          Also a strict user of CKEditor. Will try Redactor next time!
            • 18373 ☆ A M B ☆
            • 3,141 Posts
            Quote from: wintertribe at Oct 27, 2016, 08:35 AM
            Quote from: markh at Oct 27, 2016, 05:35 AM
            That would be total overkill for just adding a clearfix element into content, but it might help you answer the question if the content is the right place for a clearfix, instead of for example a section-level element that your content is wrapped by. Food for thought.

            So basically Content field can contain only "raw" text and images? And everything what even slighest effects to layout, should be in template.
            Only solution is to break my content field into multiple Richtext TVs. Even i need just clearfix-div?

            If you just want that div, redactor.convertDivs and redactor.replaceDivs to no should be sufficient to allow it.

            Talking on a more "philosophical" level though, I do think that a content field is for content. A clearfix is (like you say) related to the layout. The editor (end user) shouldn't have to think about what a clearfix is and when it needs to be inserted to fix a broken layout, they just need to focus on content. Text, mostly.

            That's my personal view on what a RTE should enable a user to do anyway, leaving the more complicated parts of layout and essentially making design decisions about a page to something like ContentBlocks. On a good day I'd even argue that images don't belong in a RTE, because you'll often want to resize the source image, and perhaps use something like the picture element instead of an img tag for responsive images. That's a specialised type of content that RTEs aren't typically equipped to deal with in a flexible way. When you start thinking about problems like that, using something like ContentBlocks starts to make sense as it takes in a raw value from the editor, and allows you to process that in many different ways.

            Again though, that's from a philosophical standpoint of how things should be in an ideal world. If all your concern is a one-off clearfix and you're the person managing the content, then sure go for it. That's a valid, pragmatic solution.

            Quote from: ilja-web at Nov 03, 2016, 04:02 AM
            Also a strict user of CKEditor. Will try Redactor next time!

            Be sure to get in touch ([email protected] or forum.modmore.com preferably) if you have any questions wink
              Mark Hamstra • Developer spending his days working on Premium Extras and a MODX Site Dashboard with the ability to remotely upgrade MODX and extras to make the MODX world a little better.

              Tweet me @mark_hamstra, check my infrequent blog at markhamstra.com, my slightly more frequent ramblings at MODX.today or see code at Github.
              • 42562
              • 1,145 Posts
              RE: mtalvenheimo
              For example if I want to add bootstrap div-clearfix element, i must add it with Chunk (except with TinyMCE).

              So why are not you using TinyMCE (I mean the official tinymce.com version) ??
              Your issue is incredibly trivial. And I dare say I am sorry you have hitherto derived much trouble over it.

              TinyMCE can build you an entire page from <html> down to </html> ... so you see that, clearfix is child's play.

              If you don't want your editing team to delete or even see the clearfixes and whatnot,
              I suggest you structure your resource with Structures: https://modx.com/extras/package/Structures
              Done!

              RE: Mark Hamstra
              On a good day I'd even argue that images don't belong in a RTE, because you'll often want to resize the source image, and perhaps use something like the picture element instead of an img tag for responsive images. That's a specialised type of content that RTEs aren't typically equipped to deal with in a flexible way.

              Wat!!?!!
              No day is good enough to engage in such an argument. What is richtext without the wealth of images? What is 1000 words if not one picture? What is a RTE without awesome image capabilities? ...
              ... Enter TinyMCE (I mean the official tinymce.com version)

              ???? That's a specialised type of content that RTEs aren't typically equipped to deal with in a flexible way ...????

              Begging to defer; though I can't speak for any other RTE on the market but TinyMCE.

              TinyMCE Changelog
              Picture element added as valid in Version 4.2.4 — August 17, 2015
              Schema support for srcset, source and picture added in Version 4.1.7 — November 27, 2014

              And done beautifully, in a flexible way.

              Blessed Thanksgiving.
                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.
                • 18373 ☆ A M B ☆
                • 3,141 Posts
                Quote from: donshakespeare at Nov 24, 2016, 02:10 AM
                RE: mtalvenheimo
                RE: Mark Hamstra
                On a good day I'd even argue that images don't belong in a RTE, because you'll often want to resize the source image, and perhaps use something like the picture element instead of an img tag for responsive images. That's a specialised type of content that RTEs aren't typically equipped to deal with in a flexible way.

                Wat!!?!!
                No day is good enough to engage in such an argument. What is richtext without the wealth of images? What is 1000 words if not one picture? What is a RTE without awesome image capabilities? ...
                ... Enter TinyMCE (I mean the official tinymce.com version)

                ???? That's a specialised type of content that RTEs aren't typically equipped to deal with in a flexible way ...????

                Begging to defer; though I can't speak for any other RTE on the market but TinyMCE.

                I had a feeling you'd disagree! wink I'm not arguing against using images, just that I don't think RTEs are always the best possible means for dealing with rich media like images, videos, widgets or what have you. If you're just throwing an image in the content and that's all you're going to do with it, then sure, use the RTE.

                But the name of the thing is still "rich text editor". Build fancy plugins all you want, but its core goal is to enhance text. If that includes a nice image on the side, fine. But if it includes a nice image that has several breakpoints of automatically generated (or manually selected) crops, the markup of which you might need to change across all resources on your site because you've switched polyfills or forgot the IE8/9 conditional comment markup to make it work cross-browser, that's when I'd argue for separating the markup (an
                <img>
                or
                <picture>
                tag) from the content (the image/image url), and to use specialised blocks for specialised types of content.

                It's called Modular Content and is a way of thinking about/building pages beyond just an image in the content and a dozen templates to choose from.

                That's where something like ContentBlocks comes in, which allows you to use a RTE for blocks of basic content (including images if you want), as well as special widgets with their own processing and templates for content that needs a bit more markup/content separation.

                Again, maybe you don't need anything like that. Insert an image here, make it accept a div there. For many people that's all they need, and they've got plenty of choice to do that!

                But when you start approaching things with modular content in mind, you're going to need something other than a RTE at the core in my opinion. It will most likely still use a RTE, and you may not use it on every single page because your blog is just a bunch of text and images compared to your landing pages, but it's a different set of ideas that deserves something different.

                If you disagree with that and still think I'm blasphemous by saying images or other rich types of content don't always belong in a RTE, I'd love to hear why you decided to work on Structures, as the idea of that extra is rather similar despite the different implementation wink
                  Mark Hamstra • Developer spending his days working on Premium Extras and a MODX Site Dashboard with the ability to remotely upgrade MODX and extras to make the MODX world a little better.

                  Tweet me @mark_hamstra, check my infrequent blog at markhamstra.com, my slightly more frequent ramblings at MODX.today or see code at Github.