We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 20613
    • 18 Posts
    In reference to the thread on creating square thumbs: http://modxcms.com/forums/index.php/topic,34127.0.html

    I am using the phpthumb plugin which I have got working in my child galleries but how do you get it to work with the gallery previews? I think the maxi gallery preview page refers to the galleryOuterTpl. I thought I could do something similar by creating a chunk with the galleryOuterTpl code instead of the galleryPictureTpl in the example from the quoted thread and amend the <img> tag but of course there aren’t any img tags so does anyone know how to apply square thumbs to the parent gallery (ie the gallery preview page)?
      • 7923
      • 4,213 Posts
      What do you mean by "gallery previews"?

      galleryPictureTpl is used for rendering thumbnails, pictureTpl is used when viewing a single image in normal display mode and childgalleryTpl is used to render child galleries.


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

        Hi Doze,

        Sorry I didn’t make that quite clear, by gallery previews I meant the parent page that displays all the child galleries. So on that page I have:

        [!MaxiGallery? &display=`childgalleries`!]

        The child galleries contain:

        [[MaxiGallery? &display=`embedded` &embedtype=`slimbox` &pics_in_a_row=`5` &max_thumb_size=`110x110` &max_pic_size=`0` &disable_js_libs=`1` &galleryPictureTpl=`square_chunk`]]

        The square thumbs for the child galleries work, but not sure how to make the parent page have square thumbs.

          • 20613
          • 18 Posts

          Ok done it smiley

          I originally made a chunk and copied childgalleriesTpl into it and amended the code to use phpThumbs but when I set the call to the chunk in my parent document it didn’t work ie:

          [!MaxiGallery? &display=`childgalleries` &childgalleryTpl =’square_gallery’!]



          So I updated the actual file childgallerytpl.html. Before I updated it was:

          <li>
          <a href="[+maxigallery.childurl+]">
          <img src="[(base_url)][+maxigallery.path_to_gal+]tn_[+maxigallery.picture.filename+]" 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>



          After code updated:

          <li>

          <a href="[+maxigallery.childurl+]">
          <img src="[*myimage:phpthumb=`h=100&w=100&zc=1#[+maxigallery.path_to_gal+][+maxigallery.picture.filename+]#1`*]" class="thumbnail" title="[+maxigallery.strings.go_to_gallery+] [+maxigallery.strings.click_to_zoom+]" alt="[+maxigallery.strings.go_to_gallery+] [+maxigallery.strings.click_to_zoom+]" />

          </a>
          <p style="width:[+maxigallery.picture_width_thumb+]px;">[+maxigallery.pageinfo.pagetitle:htmlent+]</p>
          </li>


          Cheers
            • 7923
            • 4,213 Posts
            Quote from: MulaG at Oct 21, 2009, 01:27 PM

            it didn’t work ie:

            [!MaxiGallery? &display=`childgalleries` &childgalleryTpl =’square_gallery’!]

            If you had the call exactly like that, it won’t work because you have used single quotes ’ and not back ticks ` and you have extra space after parameter name.

            This should work (if there is a chunk named "square_gallery" with correct content):
            [!MaxiGallery? &display=`childgalleries` &childgalleryTpl=`square_gallery`!]
            




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

              Oooops!! Thanks for pointing that out smiley