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

    I’m trying to make a fairly dynamic "gallery overview" which is really just a gallery created by getting 1 pic from each of a bunch of different "real galleries" while also maintaining an overall pic limit for the "overview gallery".

    I’m able to achieve my goal by statically stating the picids in a query, but I need something a little more dynamic.

    Here is the basic setup:
    Category 1: (page id=60) --this is my "gallery overview" (a gallery comprised of 1 pic from each gallery that I specify)
    Gallery 1.1 (page id=61) -- these are "regular" galleries (using the pic and thumbs on same page layout, btw)
    Gallery 1.2 (page id=62)
    Gallery 1.3 (page id=63)
    Gallery 1.4 (page id=64)


    In plain English, this is what I’m going for:
    Get only 1 pic from each of the following galleries:[a list of galleries], starting with the lowest pic pos#, limit the total number of pics to 4.

    Here is the Maxigallery call that I thought would work (but doesn’t):
    [!MaxiGallery? &gal_query_ids=`61,62,63,64` &limit=`1` &pics_per_row=`2` &max_pic_number=`4` &order_by=`pos` &order_direction=`ASC`!]

    Here are some of the problems I’ve noticed:
    The &limit parameter used for the query seems to override the &max_pic_number parameter. Also, the &limit param will keep getting pics from the first gallery specified, until the last pic of the first gallery is reached or the limit specified is reached.

    Is there anything I’m doing wrong or that I could do differently to achieve my goal? If not, could you please give me some advice on how I might be able to modify Maxigallery to achieve this? (I really don’t want to do the latter, but if I have to I will).

    Modx .96p2
    Maxigallery trunk r_165

    Thank you,

    bhop

    edit:
    Well, I’ve been working at it, and I’ve found that MG’s native &childgalleries_ids param allows me to get the results I’m after. Also, my use of the &max_pic_number param to limit the pics on my "gallery overview" page is not really the best way to go. Instead, I now am using the &pics_per_page parameter, and I’ve modified the (in my case) &galleryOuterTpl to remove the pagination navigation output.

    here is the call:
    [!MaxiGallery? &childgalleries_ids=`61,62,63,64` &order_by=`pos` &order_direction=`ASC` &pics_per_row=`2` &pics_per_page=`4` &display=`childgalleries` &childgalleries_level_limit=`1`!]
      • 7923
      • 4,213 Posts
      The &max_pic_number parameter actually limits how many pictures you can upload to a gallery, not how many it will display.. I’ll make the description better in the wiki.

      The &limit parameter is used to set how many pictures will be retrieved and shown. So I guess you could also use the following call:

      [!MaxiGallery? &childgalleries_ids=`61,62,63,64` &order_by=`pos` &order_direction=`ASC` &pics_per_row=`2` &limit=`4` &display=`childgalleries` &childgalleries_level_limit=`1`!]

      or:

      [!MaxiGallery? &gal_query_ids=`61,62,63,64` &limit=`4` &pics_per_row=`2` &order_by=`pos` &order_direction=`ASC`!]



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