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

    If I have understood correctly you want something like this:
    <div id="left-main-image">
        <img src="#" alt="#" />
    </div>                  
    <div id="right-gallery">  
    <div class="right-gallery-thumbs">   
             [!autoGallery?itemchunk=janicesChunk!]
    </div>
    </div>


    Then a chunk called ’janicesChunk’ like this:
    <a href="[+imgpath+]" title="[+title+]"/><img src="[+tnimgpath+]" alt="[+title+]" /></a>
    


    That will give you lots of copies of janicesChunk, each one with a linked image.


    Hope this helps, if not: ask Martyn wink

    Ramsay
      • 24449
      • 81 Posts
      Getting the placeholders right in my own snippet would be rather more impressive....

      <a href="[+imgpath+]" alt="[+title+"><img src="[+tnpath+]" border="4" hspace="6" vspace="6"  width="170" /></a>


      Might work better (notice its [+tnpath+] not [+tnimgpath+])

      Ramsay
        • 24449
        • 81 Posts
        And closing the square brackets on things...
        <a href="[+imgpath+]" alt="[+title+]" ><img src="[+tnpath+]" alt="[+title+]" /></a>

          • 36549
          • 572 Posts
          Sorry responded to wrong post tongue
            www.9thwave.co.uk
               WEB | DESIGN | PRINT
            • 24449
            • 81 Posts
            For anyone following AutoGallery: I am waiting for the new version to get accepted into the MODxcms.com repository. In the mean time you can downloaded it from here:

            http://www.zombietuesday.com/autogallery.html

            Please post any complaints or questions to this thread. If I don’t answer in a timely fashion send me an email and I’ll stop playing hardwar for a few minutes and have a look wink


            Ramsay
              • 9757
              • 82 Posts
              Hi there,

              I’m trying to set-up AutoGallery but without success till now.

              This is mine itemchunk code:
              <a id="[+filename+]" href="[+imgpath+]" rel="lightbox[gallery]" title="[+filename+]">[+filename+]</a>


              It doesn’t return +filename+. Why? Anybody got any idea?

              Thnx in advance smiley
                • 24449
                • 81 Posts
                Hi!

                The answer is because I’m an idiot and managed to break that bit when I updated the code. wink

                The new version I’ve just put up at http://www.zombietuesday.com/autogallery.html should work.
                I’m having a bit of trouble with the modxcms.com releaseme forms, so the version that has just been released on here is a few steps back from the good version.
                Please tell me about any more problems here or by email!

                For anyone interested it also now supports transparency in png files - and will retain the transparency in the thumbnails.



                Ramsay
                  • 9757
                  • 82 Posts
                  Thnx for answer. Now it’s working with +filename+, but there are static values setted for ’tnwidth’, ’tnheight’ and ’quality’ in line 33:
                  function generateTN($srcfile, $tnimgpath, $tnwidth = 190, $tnheight = 245, $quality = 100) {


                  I think that it would be better when it’ll be naming thumbnails without duplicating extensions i.e.: not ’tn_image.jpg.jpg’ but just ’tn_image.jpg’.

                  $params['tnpath'] = $basepath . $gallery . '/tn_' . $params['filename'];


                  works for that just fine.

                  And just one more question, I’m a MODx newbee, how to add ’+title+’ and ’+description+’ to the database with your snippet? Any suggestions?

                  Thnx for this snippet it’s just what I needed smiley
                    • 24449
                    • 81 Posts
                    Hi,

                    They aren’t static values, they’re default values. If you call generateTN($src, $dst); you will get a 100% quality image thats 190x245px. If you call generateTN($src, $dst, 200); you will get a 100% quality image thats 200px wide and it calculates a height thats in proportion to the original image.

                    Yes, the filenames are a bit odd but it was a deliberate choice: most (if not all) OSes will allow filename.flv and filename.jpg to exist in the same folder. In this case, which file has the thumbnail "tn_filename.jpg"? This came up when we were doing things like albums with "title tracks" - you would have "Adrenaline.jpg" as the cover art for the album "Adrenaline" that contains "Adrenaline.mp3". Since the gallery folder is supposed to be a backend thing I wasn’t too concerned about it looking a bit odd.

                    As for database addition: our server comes with cpanel, that comes with phpMyAdmin, which is a web tool for modifying databases. Maybe I need to release my gallery add/modify code too... smiley


                    Ramsay
                      • 9757
                      • 82 Posts
                      Quote from: ramsay at Sep 15, 2009, 10:58 AM

                      They aren’t static values, they’re default values. If you call generateTN($src, $dst); you will get a 100% quality image thats 190x245px. If you call generateTN($src, $dst, 200); you will get a 100% quality image thats 200px wide and it calculates a height thats in proportion to the original image.

                      Ok. That’s right, I’ve got some error with that thing too, so I thought they are static. Sorry.

                      Quote from: ramsay at Sep 15, 2009, 10:58 AM

                      Yes, the filenames are a bit odd but it was a deliberate choice: most (if not all) OSes will allow filename.flv and filename.jpg to exist in the same folder. In this case, which file has the thumbnail "tn_filename.jpg"? This came up when we were doing things like albums with "title tracks" - you would have "Adrenaline.jpg" as the cover art for the album "Adrenaline" that contains "Adrenaline.mp3". Since the gallery folder is supposed to be a backend thing I wasn’t too concerned about it looking a bit odd.
                      Right. But a little bit of additional logic would do the trick.

                      Quote from: ramsay at Sep 15, 2009, 10:58 AM

                      As for database addition: our server comes with cpanel, that comes with phpMyAdmin, which is a web tool for modifying databases. Maybe I need to release my gallery add/modify code too... smiley

                      It’ll be nice.

                      One more thing. AutoGallery create database table not respecting MODx database prefix and default charset - that could generate problems.

                      fx