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

    I’m trying to configure tinyMCE so that it generates HTML code (
    and not
    ) but can not find how to do that...

    ... how can I modify tinyMCE.init ??

    regards
      • 27708 MODX Staff
      • 2,502 Posts
      I don’t think you can. TinyMCE and FCKEditor both either ouput crap or XHTML. You could use a plugin to strip the space-slash in
      and <link /> and <img /> elements from the content just before it goes to the browser. It would then be valid and you wouldn’t need to hack Tiny as I think the replacements are all mode driven and in the core not part of a plugin. Otherwise you can check the TinyMCE forums for more info.

      Cheers,

      Jay
        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
        • 4041
        • 788 Posts
        Here is the configuration option I think you are looking for:
        http://wiki.moxiecode.com/index.php/TinyMCE:Configuration/element_format

        A complete list of all configuration options is here:
        http://wiki.moxiecode.com/index.php/TinyMCE:Configuration
          xforum
          http://frsbuilders.net (under construction) forum for evolution
          • 27708 MODX Staff
          • 2,502 Posts
          WOW! I am happy to be wrong. I don’t EVER use XHTML on my own projects and never found this.

          Thanks for this link.

          Jay
            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
            • 21000
            • 11 Posts
            Quote from: smashingred at Oct 24, 2008, 07:01 AM

            I don’t think you can. TinyMCE and FCKEditor both either ouput crap or XHTML. [...]


            For FCKEditor, adding the following line in fckconfig.js seems to work...
            FCKConfig.DocType = ’<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">’ ;

              • 27708 MODX Staff
              • 2,502 Posts
              Okay,

              I am wrong. But I love it! Thanks both.

              Cheers,

              Jay
                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
                • 21000
                • 11 Posts
                Quote from: Breezer at Oct 24, 2008, 07:11 AM

                Here is the configuration option I think you are looking for:
                http://wiki.moxiecode.com/index.php/TinyMCE:Configuration/element_format

                A complete list of all configuration options is here:
                http://wiki.moxiecode.com/index.php/TinyMCE:Configuration

                Yes, but where is tinyMCE.init when tinyMCE is used as a MOdx plugin?? ... cant find... snifffff...
                  • 27708 MODX Staff
                  • 2,502 Posts
                  /asssets/plugins/tinymce(version)/tinymce.functions.php and look for $tinymceinit .= and insert it around there. It should work. This is around line 139 in version TinyMCE 3.

                  There may well be a better/ more correct way but that is my instinct.
                    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
                    • 21000
                    • 11 Posts
                    Quote from: smashingred at Oct 24, 2008, 07:57 AM

                    /asssets/plugins/tinymce(version)/tinymce.functions.php and look for $tinymceinit .= and insert it around there. It should work. This is around line 139 in version TinyMCE 3.

                    There may well be a better/ more correct way but that is my instinct.

                    Adding this line worked...
                    $tinymceInit .= "         element_format : \"html\",\n";

                    thanks! ... but I’ll have to edit this file on every tinyMCE upgrade... No way to configure that in the manager?
                      • 27708 MODX Staff
                      • 2,502 Posts
                      I don’t know if there is a way to append or override this with a config setting. I agree this is a hassle.
                        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