We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 16639
    • 26 Posts
    Hello guys! I’m making a site for my friend, who is photographer and artist. So the most important part of his site are galleries. And he asked me - whether it is possible to make the following thing. For example we have a gallery. He wants to make the individual thumbnail for each of the pictures in the gallery. As I see it - on the picure image we select the rectangle (some javascript) and later maxigallery via phpthumb or something else generates the thumbnail from the selected area.

    And the second thing, that may be simpler - my friend wants the thumbnails with which the galleries are represented in the gallerylist to be bigger than the thumbnails in the gallery itself - so if it would be possible to select the picture in the gallery for the thumbnail and set up this gallery thumbnail, with which the gallery would be presented in the gallerylist - it would be great.

    Now both those things can be achieved manually - by playing with the images in the galleries and paths to them. But this looks like some sort of dirty hacking to me=)

    Thank you very much! MaxiGallery and MODx are awesome! You are doing a great job =)
      • 7923
      • 4,213 Posts
      You can make it so that the first picture in the galleries is used for the child galleries view and is skipped in galleries view (by using &offset parameter in the galleries call). Then you can use the phx:phpThumb modifier to modify the first picture from the bigger size to what you want in childgalleryTpl. I have posted to some thread info about how to do the very same thing, but didn’t find it with quick searches.. I’ll post the link later.

      Oh and BTW, I splitted this to a separate topic from the priorities topic. That priorities topic is only for commenting about what you want to see in MaxiGallery next.

      EDIT:
      The thread in question was http://modxcms.com/forums/index.php/topic,15414.0.html

      There’s not much information, but basicly, you need to add &offset=`1` to the maxigallery calls, so they skip the first picture in the gallery. Then when you do the childgalleries view, get the first picture there. Then you will have separate pics for the childgallery list than what’s in the gallery itself.

      Then do a custom &childgalleryTpl where you remove the "tn_" prefix from the image filename, so that you use the normal version from the image and then use the phx:phpThumb modifier to modify the picture as you want. Eg. make the picture rectangle or what you want. Like:
       	<li>
       	        <a href="[+maxigallery.childurl+]">
       	                <img src="[(base_url)][+maxigallery.path_to_gal+][+maxigallery.picture.filename:phpthumb=`w=450`+]" class="thumbnail" title="[+maxigallery.strings.go_to_gallery+]" alt="[+maxigallery.strings.go_to_gallery+]" />
       	        </a>
       	        <p style="width:[+maxigallery.picture_width_thumb+]px;">[+maxigallery.pageinfo.pagetitle:htmlent+]</p>
       	</li>
      


        "He can have a lollipop any time he wants to. That's what it means to be a programmer."
        • 16639
        • 26 Posts
        Hello! Thank you! Sorry for not replying faster - I didn’t find my post in the previous topic, and I thought that it was just removed. You problem solution is better than mine - I uploaded the file logo.jpg - that was supposed to be represent the gallery in the list of galleries and made it hidden. And then, while displaying the gallery list added a hardlink like [path-to-gallery]logo.jpg. Then I uploaded the thumbnails - all of the thumbnail files nad the prefix thumb_ before them. I also made them hidden. I did this thing just to make the file upload of the thumbnails to be via web interface - my friend is not a big friend of computer. Uploading the files via ftp - is a terrible nightmare for him =) So I have to make everything as simple possbile. Of course one can also load the files via modx file upload. But.... well I wanted to do some hacking as usual.

        This was kind of hacking, because MaxiGallery renames images, when there is name coincidence - so you have to be very careful using this approach.
          • 7923
          • 4,213 Posts
          Yea sorry, I should of left a message in the other topic that the post was moved.

          Anyways, glad that you got it working (although, I didn’t quite understand what you did smiley). The solution I described above should work pretty well and it’s then easy to create new child galleries also just by duplicating some existing gallery document.


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