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

    Im having difficult understanding the relationship between these three modules / snippets: getResources, gallery and phpthumbof

    basically what Im trying to do is produce a list of items on a homepage (like a news listing, only with thumbnail images) that display from a set of resources, using getResources:

    [[!getResources? &parents=`22` &limit=`4` &showHidden=`1` &tpl=`popularProductBox` ]] 



    The basics are working but I cant get the thumbnail to display.



    the getResources snippet is then calling a chunk (popularProductBox) which should contain a thumbnail of an image that was placed on the resource using the Gallery, like so:


    <div class="productBox"><h4>[[+pagetitle]]</h4>
    [[+photo:phpthumbof=`w=120&h=120`]]  <p>[[+description]]</p>
    <p><a href="#">Find out more...</a></p>
    </div>


    \Would be grateful for any help. The code is rendering everything except the thumbnail. I must admit, i dont really understand what phpthumbof is.... and if indeed i actually need it to do this?
      • 4172
      • 5,888 Posts
      If using a TV, the Output Type for the TV must be ’text’.
      your outputType is ’text’?
        -------------------------------

        you can buy me a beer, if you like MIGX

        http://webcmsolutions.de/migx.html

        Thanks!
        • 6408
        • 58 Posts
        Thanks for the replt, I tried changing the output to and it made no difference to the problem above, but it also - breaks the images on the main prages (just renders the snippet code) , so even if doing that worked, it would mean i could have one or the other but not both, it seems....
          • 6408
          • 58 Posts
          A bit surprised there arent any other replies to this as it seems like such an ordinary thing to want to do - does anybody have any working code examples I can work from?
            • 6408
            • 58 Posts
            Some additional info:

            GD and ImageMagick installed.

            In the GalleryItem Custom TV for gallery, the image is not previewed correctly on the page - I get a broken image, so it is not previewing the image.

            I have this in my error log:
            [2011-01-17 12:29:01] (ERROR @ /home/sites/mysite.co.uk/public_html/modxdirectory/core/model/phpthumb/phpthumb.class.php : 1312) PHP warning: getimagesize(http://www.mysite.co.uk/modxdirectory/assets/components/gallery/files/2011/01/diecutflyers.jpg) [<a href='function.getimagesize'>function.getimagesize</a>]: failed to open stream: Connection refused
            [2011-01-17 12:29:13] (ERROR @ /modxdirectory/assets/components/gallery/connector.php) [Gallery] phpThumb was unable to generate a thumbnail for: /home/sites/mysite.co.uk/public_html/modxdirectory/core/cache/phpthumb/phpThumb_cache_www.mysite.co.uk_srccb1a725dc8e28c97dee6c3972fc8d740_par8b6edf423e9a20b99bfa45555b85d2e8_dat0.jpeg
            [2011-01-17 12:29:13] (ERROR @ /modxdirectory/assets/components/gallery/connector.php) [Gallery] Error outputting thumbnail:
            OutputThumbnail() failed because !is_resource($this->gdimg_output) in file "phpthumb.class.php" on line 557


            If anyone can PLEASE help me with this - its critical to my development of this project.
              • 6408
              • 58 Posts
              Unfortunately I dont think Im in a position to use Revolution anymore. With limited documentation and a lack of resources and help to solve issues - things like this issue - using it in a live environment is just not viable. sad
                • 36607 ☆ A M B ☆
                • 44 Posts
                Hi Everyone

                I’m still struggling with this.

                The following is currently working for me:

                1. make sure in the TV that the input type and output type are both set to: galleryitem

                2. include the following in the getresources call:

                &processTVs=`1`


                My own issue relates to adding custom settings to the thumbnail image. I want the image on the home page to be a small thumbnail but to be a full image on the actual article that is linked to...

                I’m staying with revo though.
                  • 6408
                  • 58 Posts
                  You might want to check out this thread: http://modxcms.com/forums/index.php/topic,56733.msg340825.html#msg340825

                  Borrowing ideas from other people’s posts I got my snippet half-working, in that it outputs unresized images into the place holders and spews out a lot of error code. Havent got any more help with the problem though sad