We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 24629
    • 370 Posts
    hi,

    TinyMCE is removing <div>’s again. every prior solution on this forum i could find do not apply anymore in version REVO 2.1.1pl
    - in xconfig there is NO minus in front of the div
    - i cant find Manage Elements > Plugins > TinyMCE > Configuration
    etc.

    does anyone know what needs to be edited to stop TinyMCE behave like MS Frontpage’98

    Tnx
    Ralph
      • 32316
      • 387 Posts
      deep six it?
        • 24629
        • 370 Posts
        @whistlemaker

        deep six what? TinyMCE or finding an answer?
          • 32316
          • 387 Posts
          Sorry I was not being too helpful...

          I find tinyMCE rather annoying most of the time and do not use it on sites that I am the only admin/editor - but not all clients are be comfortable using html so I install it and ... >:(

          Guess I need to spend some time learning to customize it - but I’m not to hopeful.
            • 32316
            • 387 Posts
            I investigated further and found a previous thread that suggested the setting: extended_value_elements = "div[*] " would do the trick.

            I tried editing assets/components/tinymce/xconfig.js - adding div[*] near the bottom of the file to get: var tinymce_extended_valid_elements = "div[*]";
            did not work
            I also tried adding a setting to the system settings in the manager - System:system settings:tinymce and added a setting for tiny.extended_valid_elements
            did not work

            So either the changes did not work or the changes did not take (still cached?)

            I’m giving up for now...

            or maybe the setting syntax has changed - maybe Ill head over to the tinymce site and check...
              • 34127
              • 135 Posts
              Try adding a property to the TinyMCE plugin. That’s what I did to allow a few custom attributes to <a> elements with the extended_valid_elements config setting and it worked well. smiley
                • 32316
                • 387 Posts
                Well after saying I was giving up I couldn’t - after reading a bit more it seemed that the extra setting required was #div which would add a space to an empty div and then not remove it. This did not work either.

                However if I use <div>&nbsp;</div> it does not remove the div - I’m using revo 2.1.1 Works for me though I’m not sure it would be a good solution to let loose a client on, it would be way to easy for them to delete "that pointless space" and break the page


                @Rijustsaid - when you say "Try adding a property to the TinyMCE plugin" which file are you referring to? I thought that is what I was doing when editing xconfig.js - certainly there are a lot of similar settings in there.

                I’m not sure the exact problem the OP was having - if was just that tinyMCE was removing empty divs that can be solved with <div>&nbsp;</div>.
                But ultimately if a RTE is needed it would seem best to have it not be able to break functionality by removing a div or changing layout by adding p tags around a snippet or chunk call - which might require doing things a bit differently, probably not the most obvious or simplest way.
                  • 34127
                  • 135 Posts
                  I suggested editing the TinyMCE plugin element | Properties tab | Create Property, in case editing xconfig.js was being overridden somewhere and your changes weren’t being reflected. Whether that would solve TinyMCE eating empty <div>’s is another question. tongue But I try to avoid editing component files if possible, because I’m sure I’d forget to re-edit them later after an upgrade.
                    • 32316
                    • 387 Posts
                    But I try to avoid editing component files if possible, because I’m sure I’d forget to re-edit them later after an upgrade.
                    totally agree

                    I can add css_selectors using the System|System Settings manager tabs

                    I don’t have time to figure this out further - especially since I will probably avoid using anything that would trigger any of this behaviour.

                    I did notice that the insert image file browser is not behaving itself - no time to check into it - Revo 2.2.1 hosted on linux and Safari 5.05 OS 10.6.8, I have not tried any other browser or made any effort to dig into the problem since my client will be inserting images with a TV - in fact what I should be working on is how to disable tinyMCE insert image!
                      • 24629
                      • 370 Posts
                      Hi,

                      thanks for the reply so we don’t know how to stop TinyMCE to stop removing empty div’s?
                      putting a &nbsp; in it is not an option because that will result in a space i might not want.

                      anyone else have an idea how to prevent Tiny MCE from stripping empty divs ( <div class=’clear’/> || <div class=’clear’></div>) and leave it alone?

                      tnx
                      Ralph