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

    I have attempted to enable the Gallery integration for TinyMCE by turning ON the system setting for gallery.use_richtext as described here:

    http://rtfm.modx.com/extras/revo/gallery#Gallery-SystemSettings

    However, I can see no visible difference when editing resources in the TinyMCE buttons or the insert image dailog for the richtext editor. I think the problem is that I am using custom buttons list for TinyMCE or maybe I'm missing a TinyMCE plugin to make this work.

    If I need to install a plugin or add a button manually, can someone point me to the information I need to get this fixed?

    Thanks.

    Modx = 2.2.8-pl
    TinyMCE = 4.3.3-pl
    Gallery = 1.5.2-pl
      • 10484
      • 32 Posts
      I may be reading this wrong, though I think I might know what the confusion is. It sounds like you're attempting to add a gallery in the content section (or another richtext TV) of a resource to actually display the gallery. This specific setting, gallery.use_richtext, adds TinyMCE to the description of the Gallery when editing the albums in its CMP. There is a simple solution to adding a gallery within the content, though there isn't necessarily a custom button for it in TinyMCE's toolbar. You could create one, though it would require adding some custom coding to the TinyMCE Extra.

      Otherwise, adding the snippet would probably be easiest. It doesn't take much. I would create a property set under the Gallery snippet with all your parameter values, so that when you add the snippet... you could have something like:

      [[Gallery@PropertyName? &album=`1`]]


      If you only have one gallery template, you could just modify the default settings to simplify the code to:

      [[Gallery? &album=`1`]]


      Of course, you could set the default value for the "album" parameter to be a TV, making the code just:

      [[Gallery]]


      This would make it easy to select. You would just likely have to wrap it in a DIV rather than the default paragraph format.

      If you're unfamiliar with property sets, you could also create a simple chunk name (such as [[$album]]) with the Gallery snippet in it and make a listbox TV (with specific where parameters based off the gallery database table) for that resource for selecting the album to apply. This would only work if there was only one gallery per page. This would work above as well, but just adding [[*templateName]] to the album parameter.

      Hopefully this helped clear up some of the confusion.
        Garret Overstreet
        Business and Marketing Consultant
        • 6146
        • 48 Posts
        Thanks Garret.

        You are correct. What I want is a button on the TinyMCE toolbar to add an image from the Gallery into the Richtext content. I wound up using a Snippet/TV combination to get the image in the content.

        Such a button would be a nice feature. Maybe I'll add it one day.

        ~Dubs