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

    I’m using maxigallery .5 and modx .95.

    Currently I have 9 child galleries. They are being called onto a parent document with the following call:
    [!MaxiGallery? &display=`childgalleries` &is_target=`1` &childgalleries_order_by=`createdon` &childgalleries_order_direction=`DESC` &childgalleryTpl=`MainChildOverviewTpl` &max_thumb_size=`130` &pics_per_row=`2` &pics_per_page=`10`!]


    That works great. I wanted to add a featured section on this page as well that shows two random pictures from all the galleries. I thought to try the following:

    [!MaxiGallery? &gal_query_ids=`all` &query_level_limit=`5` &order_by=`random` &limit=`2` &pics_per_row=`2` &galleryPictureTpl=`RandGalleryThumbsTpl`!]


    This is doing something weird. It Does pull two pictures, But they are always the same ones in different order. One picture is from gallery 3 and one from gallery 2. They are the latest ones which show up from the first maxigallery call. On refresh the two pictures just keep on switching places and that’s it.

    Oh and each child gallery has the following call:
    [[MaxiGallery? &display=`embedded` &pictureTpl=`PictureTplComments` &galleryPictureTpl=`GalleryThumbsTpl` &max_thumb_size=`150` &max_pic_size=`420` &pic_use_watermark=`1` &pic_watermark_txt=`247 ATX` &thumb_use_dropshadow=`1` &pic_use_dropshadow=`1` &pics_per_row=`3`]]


    Am I doing something wrong here?

    Thanks,

    Josh
      • 7923
      • 4,213 Posts
      Try the SVN code, I have made changes to the random sorting


        "He can have a lollipop any time he wants to. That's what it means to be a programmer."
        • 14796
        • 59 Posts
        Thanks doze!

        The random feature works perfectly now.

        There is something else working incorrectly now. Going to the pic_img link is broken due to the following:

        http://www.mysite.com/gallery1.html?amp;pic=38

        When I change this to http://www.mysite.com/gallery1.html?&pic=38, it works correctly.

        It looks like it’s in the maxigallery.php file on several lines...but I may be incorrect.
          • 7923
          • 4,213 Posts
          Yeah, I did some changes concerning that in the code, but I forgot that I also changed the modx makeUrl function. I changed it to support/use & in links instead of & because that gives validation errors. But it doesn’t work with out the modified makeUrl function, so replace all occurrences of & with & in maxigallery.php


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