We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 6561
    • 139 Posts
    Is it possible to use two Maxigallery snippet calls on the same page?

    I’d like to have one (maxi)gallery/snippet call for a gallery with horizontal pictures and one (maxigallery)/snippet call for a gallery with vertical pictures.

    Since Maxigallery uses the document ID to create galleries, I suppose this will take some extra steps? Or maybe it is not possible?

    [B]Edit[B]: well, looks like this can only be solved by using childgalleries. In my template I have following snippet call:

    [!MaxiGallery? &view_gallery=`[*WhichGallery*]`&display=`embedded` &embedtype=`slimbox` &pics_per_row=`3` &max_thumb_size=`140x105` &max_pic_size=`0` &thumb_use_dropshadow=`0`!]
    


    I use the WhichGallery TV for my other-language pages, so that one could create the gallery in the ’main language’ document then just fill in the ID of that document in the ’mirror’ document in the other language.

    If possible, I would like to keep the Maxigallery call in my template. That way, when the user picks the right template, the button to manage the pictures is automatically there.

    So I’d like to have one main gallery, for the ’vertical/landscape’ pictures and one childgallery for the ’horizontal/portrait’ pictures. But they should be displayed like they are one and the same gallery.








      • 7923
      • 4,213 Posts
      You mean that you want all the pictures to the same slimbox picture set?

      You need to create custom galleryPictureTpl for that. Copy paste the code from the default template and change the following:

      rel="lightbox[image[+maxigallery.pageinfo.id+]set]"

      to:

      rel="lightbox[imageset]"

      That makes all images have the same picture set for slimbox.


        "He can have a lollipop any time he wants to. That's what it means to be a programmer."
        • 6561
        • 139 Posts
        yes, that answers one part of my question. The other part is: how can I construct the template so that, when creating a page based on a template (containing MaxiGallery snippet call), it includes a childgallery (for example, two ’manage picture’ buttons on the front end)?

        Another way to solve my problem - although I do not know if this is possible- is to automatically crop the vertical/portrait images so that they are the proper size. Right now I’m using CSS ’width’ and ’height’ on the thumbails to do this, but the portrait images can get terribly drawn out.

        Quote from: doze at Apr 14, 2009, 04:01 AM

        You mean that you want all the pictures to the same slimbox picture set?

        You need to create custom galleryPictureTpl for that. Copy paste the code from the default template and change the following:

        rel="lightbox[image[+maxigallery.pageinfo.id+]set]"

        to:

        rel="lightbox[imageset]"

        That makes all images have the same picture set for slimbox.
          • 7923
          • 4,213 Posts
          Hmm.. so you want that when you create a document with maxigallery template, it would automatically create a second document under that one? You’d need to write a plug-in in modx to do that.

          For the thumbnail cropping, you can use either css or phpthumb. See this http://modxcms.com/forums/index.php/topic,19628.0.html


            "He can have a lollipop any time he wants to. That's what it means to be a programmer."
            • 6561
            • 139 Posts
            So to crop, I copy the code from assets/snippets/maxigallery/templates/gallerypicturetpl.html , put it into a ’chunk’ and then in the ’if: slimbox’ part I change this:

            [+maxigallery.picture.filename+]


            to this:
             [+maxigallery.picture.filename:phpthumb=`w=140&h=105`+]


            and then put the &galleryPictureTpl=´MyNewChunk´ in the Maxigallery snippet call

            ?



            Quote from: doze at Apr 14, 2009, 09:33 AM

            Hmm.. so you want that when you create a document with maxigallery template, it would automatically create a second document under that one? You’d need to write a plug-in in modx to do that.

            For the thumbnail cropping, you can use either css or phpthumb. See this http://modxcms.com/forums/index.php/topic,19628.0.html
              • 7923
              • 4,213 Posts
              Yeah, basically, and have phx:phpThumb installed.

              But I think that the w and h parameters will do just image resizing. There are other parameters in phpThumb to do cropping. You can check the parameters from here: http://phpthumb.sourceforge.net/demo/docs/phpthumb.readme.txt


                "He can have a lollipop any time he wants to. That's what it means to be a programmer."
                • 6561
                • 139 Posts
                Quote from: doze at Apr 15, 2009, 03:52 AM

                Yeah, basically, and have phx:phpThumb installed.

                But I think that the w and h parameters will do just image resizing. There are other parameters in phpThumb to do cropping. You can check the parameters from here: http://phpthumb.sourceforge.net/demo/docs/phpthumb.readme.txt

                How should I specify to zoom-crop all thumbnails to 140x105?

                Something like this?
                 [+maxigallery.picture.filename:phpthumb=`w=140&h=105&zc`+]


                By the way, using the previous call (without the &zc part) it does not seem to resize the thumbs (I started with a new gallery just to make sure) in the ’overview’ gallery.




                  • 7923
                  • 4,213 Posts
                  I haven’t used phpThumb, so I don’t know what the exact parameters are.

                  But first make sure that phx:phpthumb installation is working. Create a document and insert some picture in it and try to resize it with phpThumb.. After that’s working look at implementing it in MaxiGallery template.

                  Try to do it something like this in maxigallery template:

                  [+phx:input=`[(base_url)][+maxigallery.path_to_gal+][+maxigallery.picture.filename+]`:phpthumb=`ws=140&hs=105&zc=C`+]

                  Or like this:

                  [+maxigallery.picture.filename:phpthumb=`ws=140&hs=105&zc=C#[(base_url)][+maxigallery.path_to_gal+]#0#1`+]


                    "He can have a lollipop any time he wants to. That's what it means to be a programmer."
                    • 6561
                    • 139 Posts
                    Thank you for your explanation, doze.

                    Well, it works, but it is resizing the big pictures now rather than the thumbnails in the gallery ... am I using the wrong Tpl/Tpl parameter?
                      • 7923
                      • 4,213 Posts
                      to resize thumbnails, use "tn_" prefix for the filename. And if you have set maxigallery to save big/original images, you can point to them with "big_" prefix.

                      E.g.

                      tn_[+maxigallery.picture.filename+] = thumbnail
                      [+maxigallery.picture.filename+] = normal picture
                      big_[+maxigallery.picture.filename+] = big / original picture


                        "He can have a lollipop any time he wants to. That's what it means to be a programmer."