We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 14020
    • 75 Posts
    Quote from: simonalexander2005 at Nov 18, 2013, 12:02 PM
    Great snippet, thanks. Is it possible to get hold of the image name without the extension in a template chunk? It would be nice to be able to use that as the alt text.

    Sure. [[+imgName]] should get that for you if it is a .jpg otherwise you will have to edit the snippit for the type image you are using. I will try to rewrite it so that it works with any file extension when I get a chance but right now I am in the middle of some major work to make my sites "Mobil First"
      • 35996
      • 6 Posts
      Quote from: jerry325 at Nov 21, 2013, 12:56 AM
      Quote from: simonalexander2005 at Nov 18, 2013, 12:02 PM
      Great snippet, thanks. Is it possible to get hold of the image name without the extension in a template chunk? It would be nice to be able to use that as the alt text.

      Sure. [[+imgName]] should get that for you if it is a .jpg otherwise you will have to edit the snippit for the type image you are using. I will try to rewrite it so that it works with any file extension when I get a chance but right now I am in the middle of some major work to make my sites "Mobil First"

      Awesome, thanks smiley
        • 14020
        • 75 Posts
        Well after getting a handle on how to make my sites "Mobile First" I found that I needed to re-write my cssSlideShow snippet. This led me to discover that I wasn't getting the same title name from the same code in getImages and I discovered that when I wrote it I had used a horrible kludge to get the folder from the URL. I decided that It was about time I corrected that and in doing so I added several new placeholders to make styling easier. Feeling proud of myself I uploaded the new version 2.2.0 and came here to spread the word. It was then that I saw the post where I promised to make [[+imgName]] work with any extension. A short time later I had that in order and I now present you with version 2.2.1 As always I would be grateful for any and all suggestions for improvements.
          • 20648
          • 26 Posts
          Hi,
          First, thank you for your great snippet.
          Is it possible to use only the getimages snippet? In the StepbyStep.txt (provided with the download of the snippet) I must make two documents, one for the menu and one for the images, using the snippets, getFolders, getFoldersList and getimages. I get that to work.
          But in the readme.txt it says that I can use only the getimages snippet, and show the images on the same page.

          I am trying to show images on the same page as the snippet call. But all a get is a "0 Photos - Page of " to show up. Can someone help me on this or point me in the right direction?

          THis is my call in the document:
          
          [[!getImages? 
          &getImages_Folder=`assets/images/produsentlogo/produsentlogo` 
          &getImages_Ext =`jpg,gif,png,JPG,GIF,PNG`
          &getImages_Image_Tpl =`getImages_producerLogo`
          &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 =`0`
          &limit =`6`
          &pageLimit=`3`
          ]]
          

          This is my chunck:
          <img src="[[+imgLink:phpthumbof=`w=96&h=96`]]" class="img-thumbnail" alt="[[+imgFile]"/>



          Regards
          Murias
          I use MODX Revolution 2.2.14-pl
            • 14020
            • 75 Posts
            The [[+imgLink:phpthumbof=`w=96&h=96`]] refers to a placeholder I am no familiar with? what do you get if you place [[+folder]] on the page? I would suspect that you forgot to un-comment the line in the snippet to pull the folder from the snippet call and comment the one above it that pulls the folder from the URL. I also see that you have the getPage calls but have not wrapped the getImages in the getPage call.
              • 20648
              • 26 Posts
              Thank you for your tips.
              By un-comment the 2.line in the snippet getImages i got it to work the way I intended.

              Like this:
              /***** SET VARIABLES *****/
              // $folder = isset($_GET['folder']) ? $_GET['folder'] : ''; // use to get folder from URL
              $folder = $modx->getOption('getImages_Folder', $scriptProperties, 'assets/photos'); // use to get default folder, or from parameters

              So for others who are interested, this is my working call and chuncks.
              [[!getPage?
              &elementClass=`modSnippet`
              &element=`getImages`
              &getImages_Folder=`assets/images/produsentlogo` 
              &getImages_Ext =`jpeg,jpg,gif,png,JPEG,JPG,GIF,PNG`
              &getImages_Image_Tpl =`getImages_producerLogo`
              &getImages_Page_Tpl =`getImages_producerLogo_Page`
              &getImages_Class =`img-thumbnail`
              &getImages_PageClass =`list-thumb list-inline`
              &getImages_InfoClass =`info`
              &getImages_ExifClass =`exif`
              &getImages_Id =`imgId`
              &getImages_PageId =`ul`
              &getImages_InfoId =`info`
              &getImages_ExifId =`exif`
              &getImages_Paging =`0`
              &limit =`6`
              &pageLimit=`3`
              ]]


              chunck for Image_Tpl
              <li><img src="[[+imgLink:phpthumbof=`w=64&h=64`]]" class="[[+class]]" alt="[[+imgName]]"/></li>


              chunck for page_Tpl
              <ul class="[[+pageClass]]">[[+photos]]</ul>


              Place the call inside your desired document and voila...
                • 14020
                • 75 Posts
                Glad to hear it's working for you. Looking at what you are actually using in your templates you could simplify your call to
                [[!getImages?
                &getImages_Folder=`assets/images/produsentlogo`
                &getImages_Image_Tpl =`getImages_producerLogo`
                &getImages_Page_Tpl =`getImages_producerLogo_Page`
                &getImages_Class =`img-thumbnail`
                &getImages_PageClass =`list-thumb list-inline`
                &getImages_Paging =`0`
                ]]
                since paging is set to 0 there is no need for the getPage calls and you are not using the info section so they can go as well. The ext is set as you have it by default so no need for it either. Of course if you leave it the way you have it you can add things to your chunk templates at any time.
                I see you are using phpthumbof. I may have to play with that myself. smiley
                  • 15877
                  • 55 Posts
                  Hello,

                  I am trying to get this snippet to work as it does exactly what I am looking for but no luck.
                  I am using GetImage 2.2.1-pl On Modx 2.3.1

                  I am trying to display the images from this directory : assets/images/expositions/expo
                  Testing on localhost, so the full path is http://localhost/sitename/assets/images/expositions/expo

                  I have tried to use the simplest snippet call possible and put the following inside a template:
                  [[!getImages?
                  &getImages_Folder=`assets/images/expositions/expo`
                  &getImages_Paging =`0`
                  &getImages_Ext =`*.jpg,*.png`
                  ]]

                  It returns: "0 Photos - page of"

                  I have left the snippet code as it was:
                  /***** SET VARIABLES *****/
                  $folder = isset($_GET['folder']) ? $_GET['folder'] : ''; // use to get folder from URL
                  // $folder = $modx->getOption('getImages_Folder', $scriptProperties, 'assets/photos'); // use to get default folder, or from parameters
                  


                  Any idea ? [ed. note: kilroy last edited this post 9 years, 7 months ago.]
                    • 3749
                    • 24,544 Posts
                    You need to comment out line2 (by adding // at the beginning), and remove the // from the beginning of line 3 to uncomment it.

                    Since you're sending the folder value as a property, it won't be in the $_GET array, so you need to get it from the $scriptProperties array with $modx->getOption().
                      Did I help you? Buy me a beer
                      Get my Book: MODX:The Official Guide
                      MODX info for everyone: http://bobsguides.com/modx.html
                      My MODX Extras
                      Bob's Guides is now hosted at A2 MODX Hosting
                      • 15877
                      • 55 Posts
                      Quote from: BobRay at Aug 26, 2014, 06:35 PM
                      You need to comment out line2 (by adding // at the beginning), and remove the // from the beginning of line 3 to uncomment it.

                      Since you're sending the folder value as a property, it won't be in the $_GET array, so you need to get it from the $scriptProperties array with $modx->getOption().

                      Thank you for this suggestion. I tried, but it returned 0 image.
                      Removing the &getImages_Paging =`0` parameters now results in showing: 9 Photos - Page of. But no image is displayed. I will try to modify the templates to get it going. [ed. note: kilroy last edited this post 9 years, 7 months ago.]