We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 42562
    • 1,145 Posts
    Following a 9yr-old cry from https://forums.modx.com/thread/27879/i-am-amazed-how-drupal-add-tinymce-as-a-module?page=4
    I sought to see if it was possible to integrate TinyMCE lightly, that is, to allow the fullness of what is TinyMCE to be re-appreciated.
    Please report problems and concerns; add functions, use-case scenarios etc. Open another topic for larger-than-life concerns.

    Technically and hopefully, all RTE questions concerning this mere wrapper should be: how is it done in TinyMCE? not, how does MODx do it, or, how does this MODx TinyMCE do it.

    http://www.leofec.com/modx-revolution/tinymce-wrapper-for-modx-manager.html
    http://modx.com/extras/package/tinymcewrapper

    This is a MODx Revolution wrapper plugin for the very latest of TinyMCE, not the ones that CMS's force you to use.
    +Deactivate this plugin to use another RTE instead
    +Set activateTinyMCE in the plugin's properties to false if you want to use with another RTE

    -It uses CDN, so no archaic TinyMCE download to hack
    -It uses the beautiful Responsive FileManager (native MODx' file browser not yet supported); it comes with the zip file. Each user can have own private upload folder
    -It comes with beautiful TinyMCE skins
    -You can turn off (permanently or temporarily on the fly) TinyMCE for any textarea or TV
    -RichTVs, File and Image TVs supported
    -TVs can be transformed even if RTE is disabled for the particular resource
    -TVs can be transformed by this wrapper even if you choose to use another RTE altogether
    -Uses pdoMenu (or anything you like) to populate the resource link list, so that you can use internal links with ease.
    -The TinyMCE configs are in chunks, right before your eyes; no need to use a talisman to find or tweak anything
    -These chunk configs can be used in the frontend with the awesome NewsPublisher (so yes, Responsive FileManager will take care of you in the frontend (Content, Rich/File/Image TVs), with no need for Manager credentials. [ed. note: donshakespeare last edited this post 9 years, 1 month ago.]
      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.
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      Sounds amazing!
        Studying MODX in the desert - http://sottwell.com
        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
        Join the Slack Community - http://modx.org
        • 28042 ☆ A M B ☆
        • 24,524 Posts
        I'm finding the documentation to be unclear. It mentions some files for the file browser, but those files don't exist.

        Go and rename this file (remove the suffix) [[++assets_url]]components/tinymcewrapper/responsivefilemanager/filemanager/config/config.php.modxReady
        Go and enter the path to your core folder in this file [[++assets_url]]components/tinymcewrapper/responsiveMODxConfig.php



        There is a config.php file and a config.inc.php file, but again I'm not clear on just what needs to be edited, or what it needs to be changed to.
          Studying MODX in the desert - http://sottwell.com
          Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
          Join the Slack Community - http://modx.org
          • 3749
          • 24,544 Posts
          The project is undergoing conversion to MyComponent, so some files may be moved or renamed. That could be why you're having trouble finding things.
            Did I help you? Buy me a beer
            Get my Book: MODX:The Official Guide
            MODX info for everyone: http://bobsguides.com/modx.html
            My MODX Extras
            Bob's Guides is now hosted at A2 MODX Hosting
            • 42562
            • 1,145 Posts
            @sottwell
            Sorry for the confusion.
            Cleaned up the official documentation
            Submitted latest Extra to MODx - changes should be implemented soon, I hope.
            Github chews up zip files for some reason, so here is the latest
            http://www.leofec.com/assets/modxextras/tinymcewrapper-2.0.1-beta1.transport.zip

            @BobRay
            Packed and refurbished by MyComponent. It installs, uninstalls perfectly, no bundle of qualms!
            Thanks a thousand for this utility.
            I judged the booked by the cover, or in this case, the MyComponent tutorial/config by the length of the scrollbar, and no, I did not give up.
            Many thanks again.
              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.
              • 3749
              • 24,544 Posts
              Wow ... fast work! It looks great.

                Did I help you? Buy me a beer
                Get my Book: MODX:The Official Guide
                MODX info for everyone: http://bobsguides.com/modx.html
                My MODX Extras
                Bob's Guides is now hosted at A2 MODX Hosting
                • 40088
                • 708 Posts
                @donshakespeare Nice update! It keeps getting better. The disable/enable checkbox is a great option.

                I just updated to 2.0.1 from 1.0.0. I see there's a new Chunk folder TinymceWrapper compared to the old one TinyMCE_Wrapper.

                Can I safely delete the old one?

                Todd
                https://creativ.space
                  Todd
                  • 42562
                  • 1,145 Posts
                  Yup, you may safely remove the old chunks.
                  Only make sure you have backed up the changes you made in order to re-implement them within the new version.

                  Consider also: duplicating all the chunks, retain their original names, but add a suffix, e.g. TinymceWrapperContent-suf, or TinymceWrapperContentHacked
                  Then open the plugin, go to default properties -> chunkSuffix, enter -suf or Hacked
                  In this way, you get to survive the dictatorial tendencies of upgrades.

                  Please test with your Articles container and child pages, do the RichTVs remain activated even when RTE is disabled for that resource? I remember you and some complained about this issue.
                    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.
                    • 37105
                    • 194 Posts
                    Wow, this one is extra, besides commercial Redactor by modmore, dropping all other RTE's for MODX off the table !! My compliments for this RTE with browser for resources.

                    I have one question for now: I would like add plugin table to the editor and I edited the chunk with plugin and toolbar values. When I enable menubar I see the correct support for tables, but plugin is not showing up in the button bar. Als when editing chunk to add plugin to context menu will not show the plugin. Just only in the menubar.

                    When inserting a table from menubar it does not add desired code to the editor. It just adds a bunch of
                    tags and it seems to be the amount of tags similar to the amount of cells adding.

                    Is option to extend extend plugins with buttons and context menu still under development?

                    This is my chunk:

                    tinymce.init({
                    selector : "#ta",
                    skin_url:"[[++assets_url]]components/tinymcewrapper/modxSkins/light",
                    //statusbar : false,
                    plugins:"autoresize,preview,paste,contextmenu,image,wordcount,fullscreen,code,link,charmap,searchreplace,textpattern,emoticons,insertdatetime,table",
                    link_list:[
                    [[$TinymceWrapperLinkList]]
                    ],
                    textpattern_patterns: [
                             {start: '*', end: '*', format: 'italic'},
                             {start: '**', end: '**', format: 'bold'},
                             {start: '#', format: 'h1'},
                             {start: '##', format: 'h2'},
                             {start: '###', format: 'h3'},
                             {start: '####', format: 'h4'},
                             {start: '#####', format: 'h5'},
                             {start: '######', format: 'h6'},
                             {start: '1. ', cmd: 'InsertOrderedList'},
                             {start: '* ', cmd: 'InsertUnorderedList'},
                             {start: '- ', cmd: 'InsertUnorderedList'}
                        ],
                    browser_spellcheck: true,
                    gecko_spellcheck: true,
                    paste_data_images: false,
                    paste_word_valid_elements: "a,div,b,strong,i,em,h1,h2,h3,p,blockquote,ol,ul,pre",
                    valid_elements: "iframe[*],object[*],audio[*],-span[!title|!class<test test2],a[href|target|class|rel|title|data-ajax|data-iframe],strong,b,-p[class<text-align-left?text-align-center?text-align-right],br,-h1[class|data-ajax|data-iframe],-h2[class|data-ajax|data-iframe],-h3[class|data-ajax|data-iframe],-img[!src|!alt|!class=round_img|data-ajax|data-iframe],em,-blockquote,pre[class],-ol,-ul,-li,-code[class]",
                    valid_children: "-li[ul],-li[ol],-li[div],-strong[*],-em[*],-h1[*],-h2[*],-h3[*],-a[strong|em|h1|h2|h3|p|div],blockquote[p|ol|ul],pre,div",
                    menubar:true,
                    relative_urls: false,
                    resize:true,
                    autoresize_min_height:100,
                    toolbar: "undo redo | newdocument | fullscreen preview | undo redo | blockquote | bold | italic | aligncenter | bullist numlist | link unlink | image responsivefilemanager | styleselect | tablecontrols charmap emoticons insertdatetime | searchreplace",
                    image_advtab: true,
                    external_filemanager_path: "[[++assets_url]]components/tinymcewrapper/responsivefilemanager/filemanager/",
                    filemanager_title: "Responsive Filemanager 9.9.3 For MODx Revo 2.3+",
                    external_plugins: {
                          filemanager: "[[++assets_url]]components/tinymcewrapper/responsivefilemanager/filemanager/plugin.min.js",
                          responsivefilemanager: "[[++assets_url]]components/tinymcewrapper/responsivefilemanager/tinymce/plugins/responsivefilemanager/plugin.min.js"
                        },
                    contextmenu: "removeformat | link | image responsivefilemanager | tablecontrols | code",
                    
                     setup: function(editor) {
                            editor.on('keydown', function(evt) {
                                if (evt.keyCode == 83 && evt.ctrlKey && !evt.shiftKey && !evt.altKey && !evt.metaKey) {
                               evt.preventDefault();
                               $('#modx-abtn-save button').trigger("click");
                           }
                            });
                        }
                    });
                      Codeplaza Webdesign: for professional websites at low cost
                      • 37105
                      • 194 Posts
                      Just solved it! I was still using tablecontrol as controller for the toolbar but it has to be table and specific control properties in context menu. Also I had to edit the valid elements list to accept table tags.

                      toolbar: "undo redo | newdocument | fullscreen preview | undo redo | blockquote | bold | italic | aligncenter | bullist numlist | link unlink anchor | image responsivefilemanager | styleselect | table charmap emoticons insertdatetime spellchecker | code searchreplace",


                      contextmenu: "removeformat | link | image responsivefilemanager | inserttable | cell row column deletetable | code",


                      So just the compliments remain in my post smiley
                        Codeplaza Webdesign: for professional websites at low cost