We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 52740
    • 2 Posts
    sabinavandijk Reply #1, 10 years ago
    Hello,

    I'm quit new to MODX and i want to make a gallery, after reading i came to the conclusion that the snippet getImages should do the job perfectly, so i downloaded it.
    But to me it's like abracadabra...

    I have this code in my html:

    <ul class="works-grid">
    <li class="work-item">
    <a href="assets/images/vastgoed/groot/01-min.jpg" class="work-lightbox-link">
    <div class="work-img">
    <img src="assets/images/vastgoed/klein/01-min.jpg" />
    </div>
    </a>
    </li>
    </ul>

    (above one <li> for the example, but there are 16 of them, so 16 images to start with)

    it's pretty staightforward html, and static it works like charm, but i can't figure out how to make this work with getImages, There's no info about it in Dutch, i just can't figure it out.. I know very little about placeholders etc.
    I understand that it must be possible to getl all images in a file (for example assets/images/etc....) at once and that would be great.

    Is there anyone who can help me, i would be very, very thankfull smiley
      • 28432
      • 372 Posts
      Hi,

      First i never used this Snippet (I got my own one).
      I found this page (for you) : https://modx.pro/help/5472/
      Here the Snippet call with all available config :
       [[!getImages? 
       &getImages_Folder=`assets/photos` 
       &getImages_Ext =`jpg,gif,png,JPG,GIF,PNG`
       &getImages_Sort = `filemtime`
       &getImages_Image_Tpl =`getImages_Image_Tpl`
       &getImages_Page_Tpl =`getImages_Page_Tpl`
       &getImages_Width =`150`
       &getImages_Heigth=`100`
       &getImages_Border=`2`
       &getImages_Class =`imgClass`
       &getImages_PageClass =`section`
       &getImages_InfoClass =`info`
       &getImages_ExifClass =`exif`
       &getImages_Id =`imgId`
       &getImages_PageId =`section`
       &getImages_InfoId =`info`
       &getImages_ExifId =`exif`
       &getImages_Paging =`1`
       &limit =`6`
       &pageLimit=`3`
       ]]


      And there all available placeholder :
      $modx->setPlaceholder('width', $width); // set width place-holder
      $modx->setPlaceholder('height', $height); // set height place-holder
      $modx->setPlaceholder('border', $border); // set border place-holder
      $modx->setPlaceholder('class', $class); // set class place-holder
      $modx->setPlaceholder('pageClass', $pageClass); // set class place-holder
      $modx->setPlaceholder('infoClass', $infoClass); // set class place-holder
      $modx->setPlaceholder('exifClass', $exifClass); // set class place-holder
      $modx->setPlaceholder('id', $id); // set id place-holder
      $modx->setPlaceholder('pageId', $pageId); // set id place-holder
      $modx->setPlaceholder('infoId', $infoId); // set id place-holder
      $modx->setPlaceholder('exifId', $exifId); // set id place-holder
      $modx->setPlaceholder('total', $tot); // set total place-holder
      $modx->setPlaceholder('photos', $photos); // set photos place-holder


      For exemple you can call it like this in your chunk tpl :
      [[+width]]
      [[+height]]
      [[+border]]
      [[+class]]
      ...


      I hope this help.
        • 52740
        • 2 Posts
        sabinavandijk Reply #3, 10 years ago
        Hi Steeve,

        I used this snippet and it took me quit a while but i managed to get it work!
        Thank you for your help!
          • 28432
          • 372 Posts
          Quote from: sabinavandijk at Sep 19, 2016, 01:03 AM
          Hi Steeve,

          I used this snippet and it took me quit a while but i managed to get it work!
          Thank you for your help!

          Your welcome!

          PS : Can you make this post as "answered" please ?