On March 26, 2019 we launched new MODX Forums. Please join us at the new MODX Community Forums.
Subscribe: RSS
  • I want to add a new Insert/edit image button to the TinyMCE toolbar that functions identically to the built-in one (opens the popup with all the options, etc.), but has a different HTML output once you click the Insert button. More specifically, I want the second button to output the code in a way that works with my lazy loading setup. Whereas the first button just outputs code for a normal image like usual. That way I can choose what I want on an image by image basis.

    Normally, I try not to post help topics without trying something first, but I frankly can't figure out where to start. I've found how to add a custom button to TinyMCE editor (http://community.tinymce.com/tryit/3_x/custom_toolbar_button.php), but that's about it.

    I also found some code related to the Insert/edit image button under assets/components/tinymce/jscripts/tiny_mce/plugins/advimage, but nothing that seems to change the HTML output. My hope was to just copy/paste all the files under a new name and change the output, then add the button with the new name under System Settings. A method that would probably break upon updating TinyMCE, but it would get me by.

    I appreciate any help or direction!

    • RE: FireBot, I like fine scenarios, and yours is a fine one indeed, and I am still trying to understand you. The long answer is yes, what you want to achieve is very easy and possible.

      First of all, please change your time zone, it is 2018, not 1878. Here is a bonus time machine ticket for you, use it for free, it will solve 3/4 of your current problem: install http://modx.com/extras/package/tinymcewrapper and then you will get my full attention here and that of others more responsibe than I.

      Happy New Year
        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.