We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 7560
    • 6 Posts
    Hi, I searched through the forum but I didn’t found this question.

    I’ll try to show you the scenario.

    I’d like to show in quick manager edit field (or in manager panel) a button to browse all the photos of a gallery (or all galleries), and, if the user choose one image, insert it into the resource’s content.

    I know how to insert an image in a document (http://modxcms.com/forums/index.php/topic,28375.0.html). But I don’t know if there is a method to browse the photos.

    The only method I think now is to write a snippet that extracts a random photo from a gallery and inserts into the document, but I’d like to let the user choosing his favourite image.

    thanks and however sorry for my bad english smiley
      sorry for my bad english smiley
      • 7923
      • 4,213 Posts
      Well, if you can handle javascript, you could do custom templates to maxigallery that execute some javascript function when thumbnail is clicked and that function enters the necessary image tag to the document editing field.. but yea... needs work to setup such thing.


        "He can have a lollipop any time he wants to. That's what it means to be a programmer."
        • 7560
        • 6 Posts
        Quote from: doze at Feb 08, 2010, 03:59 PM

        Well, if you can handle javascript, you could do custom templates to maxigallery that execute some javascript function when thumbnail is clicked and that function enters the necessary image tag to the document editing field.. but yea... needs work to setup such thing.

        I’ll try... I’d like to integrate this feature on NewsManager. thanks smiley
          sorry for my bad english smiley
          • 7560
          • 6 Posts
          I’ve found a simple solution that is useful for now... smiley

          I’ve added a config option to MaxiGallery (path_to_page_galleries) that is ’assets/images/’. I’ve used ’keep_big_img’ with ’max_big_size’ = ’200’.

          Now I would like to change the ’handlePics’ function to upload the big image to path_to_page_galleries. So, when an user is editing a page, he can choose all the photos that he uploaded on gallery, with a size of max 200 px.

          It’s the fastest alternative I’ve found... Another way is to change javascript code of modx file browser, but I don’t have a lot of time to spend for this... smiley
            sorry for my bad english smiley
            • 7923
            • 4,213 Posts
            Do you mean that when pictures are uploaded to a document, they are also copied to second location that is accessible with TinyMCE resource browser? Yeah.. that’s a fast way to do it. You need to modify maxigallery functions that upload or delete pictures to also copy / delete to / from the second location too, but that’s it.


              "He can have a lollipop any time he wants to. That's what it means to be a programmer."
              • 7560
              • 6 Posts
              Yeah... I’ve made this little hack in MG!!! smiley

              Now, big_[image_name] is in a location that is accessible with TinyMCE.
                sorry for my bad english smiley
                • 20413
                • 2,877 Posts
                Please share your hack! smiley
                  @hawproductions | http://mrhaw.com/

                  Infograph: MODX Advanced Install in 7 steps:
                  http://forums.modx.com/thread/96954/infograph-modx-advanced-install-in-7-steps

                  Recap: Portland, OR (PDX) MODX CMS Meetup, Oct 6, 2015. US Bancorp Tower
                  http://mrhaw.com/modx_portland_oregon_pdx_modx_cms_meetup_oct_2015_us_bancorp_tower