We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 37523
    • 141 Posts
    Is there a way to get TinyMCE to call a Gallery browser instead of its own image browser when you click on the Insert/edit image button?

    Thanks in advance.
      Glyn Szasz
      Sydney, Australia

      Happy to help (when can) and happy to learn

      If you are a Sydney based MODX developer would love to hear from you. Please contact me.
      • 23299
      • 1,161 Posts
      Interesting question. But I am not sure this is the best path here.

      One one of my sites I have a "gallery" page that shows a set of albums. I paginate and and present these with the JAIL loader system and the color box jQuery script.

      I can also present a single Galley driven album on any page I like. What I did is create a chunk called galleryInsert that looks like this:
      <div id="galleryBox">
      [[Gallery? &album=`[[*galleryInsertTV]]` &toPlaceholder=`Gallery` &useCss=`0` &containerTpl=`GalleryAlbumTpl` &thumbWidth=`80` &thumbHeight=`80` &thumbTpl=`GalItemThumb` &imageWidth=`1000` &imageHeight=`800`]]
      [[+Gallery]]
      </div>


      I then just drop the chunk name where I want the gallery album to appear on the front end page. Of course I use the Manager>Components>Gallery>Create Album path to create the album and upload my images first. Inside that chunk I have a TV that lets me add the album number. So when creating the page I add the chunk name and then enter the album number in the Template Variables pane. Once set up this is super easy to add and manage gallery albums wherever I want them. Its just three mouse clicks really.

      Bottom line here: all these RTE (like TinyMCE) systems are a pain. They are flaky, often mess with your code and cause issues when upgrading MODx or the actual TinyMCE plugin itself. I think it best to not add any extra heavy lifting to TinyMCE but rather make MODX do all the work.

      My $.02 anyway...