We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 20180
    • 29 Posts
    I'm using Gallery for a little device manager intranet site. Every device has a picture for easy identification.

    The main page, folder page or category page displays a number of thumbnails representing devices. It is generated throught getResources snippet

    For conversion of Gallery ImageTV output into thumbnail picture i choose not to process ImageTV in getResources and then pass the output to a little JSON decoding snippet that will return the ID of Gallery Image to be used with GalleryItem.

    but it didn't work - only the first image is shown properly the rest are copies of the first one.



    so I have changed my getResources Template into JSON decoding just image source from Gallery ImageTV and just pass it into <img src=".... >. It works but you have to resize images in the browser (BAAAD!)

    so I got another idea to just JSON decode the filename from ImageTV and put as input to phpthumbof prefixing it with static path to gallery - something like:

    <img src="[[phpthumbof? &input=`IT/assets/gallery/1/[[getPicName? &imageTV=`[[+tv.moduleImage]]`]]` &options=`w=200&h=100&zc=1`]]"

    where getPicName is a snippet extracting filename from [[+tv.moduleImage]] that is the name of the Gallery ImageTV...

    and the first problem was present once again all requests for filename were just returning 1/1.jpg... so basically it is the same problem as with the first try.

    It is not a general problem with caching because other parameters are extracted correctly and changing depending on ImageTV content, however this one (image id or image filename) has a problem, that the first entry is just repeated all the way.

    Is it a Gallery bug or I am doing something wrong???


    Best regards
    Montagproject

      Kind Regards
      ====================
      montagproject
      • 42046
      • 436 Posts
      Have you tried calling getPicName uncached?

      [[!getPicName? &imageTV=`[[+tv.moduleImage]]
        • 20180
        • 29 Posts
        Quote from: absent42 at Sep 10, 2013, 09:12 PM
        Have you tried calling getPicName uncached?

        [[!getPicName? &imageTV=`[[+tv.moduleImage]]


        Yes. I think I tried every cached/uncached combination of snippets but to no avail. If I call it uncached nothing works sad
          Kind Regards
          ====================
          montagproject
          • 42046
          • 436 Posts
          What is the html output of the image list?
            • 20180
            • 29 Posts
            It is not just an image list, an image is wrapped in a module with some text and links. I will paste it tomorrow (as it is at work, where I have no access at this moment)

            When the working solutions (passing img src+path directly into <img src...> it all renders ok but if the same parameter is passed for phpthumbof in the source you have empty space where the resized image should be..., however putting the same path in that place, just not obtained as output from the snippet works well...
              Kind Regards
              ====================
              montagproject
              • 20180
              • 29 Posts
              Now this is the chunk template, thad displays thumbnails. folders are displayed with a folder image, and resources (not folders) are displayed with resource image put there through Gallery ImageTV., in the comments there are various attempts to process the ImageTV output, and the snippets there get Gallery ID, or path, or image name etc -

              The Chunk tpl (fragment):

              <li class="modulesquare">
              
              [[+isfolder:is=`1`:then=`
              
              
                  <div class="thumbnail modfolder">
              	 <a href="[[~[[+id]]]]"><img class="thumbpic" src="assets/layoutimages/folderdesktop.png" width="200" height="100" alt="folder" title="[[+description]] " data-toggle="tooltip"></a>
                    <h4>[[+pagetitle]]</h4>
                   <p style="height: 2em; margin-bottom: 2em;">[[+description]]</p> 
              	  <a href="[[~[[+id]]]]" title="wyświetl karty folderu [[+pagetitle]] " class="btn btn-primary btn-small" data-toggle="tooltip">Wejdź do folderu  <i class="icon-folder-close icon-white"></i></a>
                  </div>
              
              `:else=`
              
                 <div class="thumbnail">
              
                  	<a href="[[+tv.url]]" target="_blank">
              
              
              
              		<img class="thumbpic" src="[[getPicSrc? &imageTV=`[[+tv.moduleImage]]`]]" alt="[[+pagetitle]]" title="[[+tv.browsers]]" data-toggle="tooltip" width="200" height="100" />
              
              <!--//
              
              		[[getPicId? &imageTV=`[[+tv.moduleImage]]`]]
              
              		[[getPicSrc? &imageTV=`[[+tv.moduleImage]]`]] 
              
              		[[getPicName? &imageTV=`[[+tv.moduleImage]]`]]
              
              		well: [[getPicNameWell? &imageTV=`[[+tv.moduleImage]]`]]
              
              
                     <img src="[[phpthumbof ? &input=`IT/assets/gallery/1/[[getPicNameWell? &imageTV=`[[+tv.moduleImage]]`]]` &options=`w=200&h=100&zc=1`]]" alt="[[+pagetitle]]" title="[[+tv.browsers]]" data-toggle="tooltip" />
              
              //-->
              
              		</a>



              now:

              - pic ID gets good ID - but when it is passed to GalleryItem - all images are like the first one
              - pic SRC gets the name of the image + path - it works directly in <img src... so the path is correct but it is not the effect I want
              - pic Name is just the filename without extension - surprisingly this repeats also the first picture name generated through all entries
              - pic Name well uses some tricks to combine image ID (working well if not used in GalleryItem) with the path extracted from getPicSRC. The path and image name are always correct but yet again you cannot pass the output into phpthumbof (generated source shows just empty space where phpthumbof generated img should be.
                Kind Regards
                ====================
                montagproject
                • 20180
                • 29 Posts
                See the sample output from this part of the chunk

                <a href="https://zabdbs1" target="_blank">
                
                
                
                		<img class="thumbpic" src="/IT/assets/gallery/1/32.jpg" alt="ESET" title="IE, Firefox, Chrome, Opera" data-toggle="tooltip" width="200" height="100" />
                
                <!--//
                
                		32
                
                		/IT/assets/gallery/1/32.jpg 
                
                		1/1.jpg <-- SEE THE WRONG PICTURE NAME GENERATED HERE?
                
                		well: 32.jpg
                
                
                       <img src="" alt="ESET" title="IE, Firefox, Chrome, Opera" data-toggle="tooltip" />
                
                ......here above lack of output from phpthumbof //-->
                
                		</a>
                
                
                [ed. note: montagproject last edited this post 10 years, 8 months ago.]
                  Kind Regards
                  ====================
                  montagproject