We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 33968
    • 863 Posts
    @bennyb: Ok, I’m pretty new at this (my 3rd modx site) but am slowly figuring everything out!

    To output thumbnails using phpThumb, download and install the phpThumb snippet,

    I’m assuming EvoGallery is already installed and you know how to use it to display a gallery on your page. To control the thumbnails, you’ll need to create a custom ’item template’ that contains the phpThumb call.

    So, your EvoGallery call will look something like this:

    [[EvoGallery? &display=`images` &type=`simple-list` &tpl=`gallery-ul` &itemTpl=`gallery-li`]]
    

    I created a simple chunk called ’gallery-ul’ and added:

    <ul>[+items+]
    </ul>


    And another chunk called ’gallery-li’:

    <li>
    <a href="[+images_dir+][+filename+]"><img src="[+filename:phpthumb=`h=80&w=80&zc=C&q=65#[+images_dir+]`+]" alt="[+title+]" /></a>
    </li>


    Basically, this tells EvoGallery to output an unordered list, with each image as a new listing entry (styled however you like by CSS). The phpThumb snippet is called from the [+filename+] placeholder, with the following settings:

    h=80&w=80 - this sets the thumbnail height and width to 80px
    zc=C - this tells phpThumb to ’zoom and crop to center’, basically it shrinks the image until either the width or height is 80px, then crops from the centre to form a square thumbnail.
    q=65 - this is image quality, in this case jpeg compression of 65.

    Obviously change these to what you need for your layout, and there are many more settings you can use to control the thumbnail output - see phpThumb documentation.

    Here’s a link to existing Modx Support/Comments for phpThumb.

    Hope that helps - and if anyone has an idea about my multi-language problem from my post above, please let me know!

    Luke
      • 36926
      • 701 Posts
      Quote from: lucas at Jun 01, 2010, 02:51 AM

      @bennyb: Ok, I’m pretty new at this (my 3rd modx site) but am slowly figuring everything out!

      To output thumbnails using phpThumb, download and install the phpThumb snippet,

      I’m assuming EvoGallery is already installed and you know how to use it to display a gallery on your page. To control the thumbnails, you’ll need to create a custom ’item template’ that contains the phpThumb call.

      So, your EvoGallery call will look something like this:

      [[EvoGallery? &display=`images` &type=`simple-list` &tpl=`gallery-ul` &itemTpl=`gallery-li`]]
      

      I created a simple chunk called ’gallery-ul’ and added:

      <ul>[+items+]
      </ul>


      And another chunk called ’gallery-li’:

      <li>
      <a href="[+images_dir+][+filename+]"><img src="[+filename:phpthumb=`h=80&w=80&zc=C&q=65#[+images_dir+]`+]" alt="[+title+]" /></a>
      </li>


      Basically, this tells EvoGallery to output an unordered list, with each image as a new listing entry (styled however you like by CSS). The phpThumb snippet is called from the [+filename+] placeholder, with the following settings:

      h=80&w=80 - this sets the thumbnail height and width to 80px
      zc=C - this tells phpThumb to ’zoom and crop to center’, basically it shrinks the image until either the width or height is 80px, then crops from the centre to form a square thumbnail.
      q=65 - this is image quality, in this case jpeg compression of 65.

      Obviously change these to what you need for your layout, and there are many more settings you can use to control the thumbnail output - see phpThumb documentation.

      Here’s a link to existing Modx Support/Comments for phpThumb.

      Hope that helps - and if anyone has an idea about my multi-language problem from my post above, please let me know!

      Luke


      Thanks Luke, it was the phpThumb sytnax I was having probs with, kept getting phpthumb errors. But your example works great. Thank you.

      Sorry can’t really help on your lang prob, the only thing is I’m wondering if you can use snippet ’link_to_language’, which is needed in the lang example you’ve used, to some how get the ID of the related language page? Sorry can’t be of more help.

      Ben
        • 33968
        • 863 Posts
        Happy to help Ben!

        If you’re interested, I found a solution I am almost happy with for the multi-language gallery problem.
          • 13622
          • 74 Posts
          Quote from: bennyb at May 31, 2010, 12:06 PM

          I’ve also not managed to the get MM gallery link to work yet. It just hides the TV field.

          Hi Benny,

          Not sure if you are having the same problem I am, but I figured out why my gallery link wasn’t working correctly. When I upgraded to MODx 1.03, it installs an updated version of ManagerManger, which then reverts back to it’s default chuck call mm_demo_rules. I had mines set as something else.

          Works great now...
            • 36926
            • 701 Posts
            Quote from: jasonimani at Jun 02, 2010, 04:04 PM

            Hi Benny,

            Not sure if you are having the same problem I am, but I figured out why my gallery link wasn’t working correctly. When I upgraded to MODx 1.03, it installs an updated version of ManagerManger, which then reverts back to it’s default chuck call mm_demo_rules. I had mines set as something else.

            Works great now...

            Thanks for reply Jasonimani, unfortunatly that doesn’t seem to be the problem for me. My modx 1.0.3 was a fresh install and I’ve amended the default mm_demo_rules so it only has the evo gallery bit in it and still no luck. I’ve actually tried on a couple of install, not sure if it’s something i’m doing wrong or not.

            I am getting the ID for the module right? I’m going to the evo gallery module, right clicking and opening in new tab and using the value of id parameter in the URL.

            /manager/index.php?a=112&[b]id=2[/b]
            


            Thanks

            Ben
              • 33968
              • 863 Posts
              Ben, looks like your id should be 2, so your ManagerManager entry should be something like:
              mm_galleryLink('tvevoLink', '', '', '2');


              Maybe post your ManagerManager contents here if that doesn’t work...
                • 36926
                • 701 Posts
                Quote from: lucas at Jun 03, 2010, 03:52 AM

                Ben, looks like your id should be 2, so your ManagerManager entry should be something like:
                mm_galleryLink('tvevoLink', '', '', '2');


                Maybe post your ManagerManager contents here if that doesn’t work...

                I’m actually keeping the MM chunk simple. All i have is:
                mm_renameField('introtext','Summary');
                mm_galleryLink('Gallery', '','', '3');
                


                I’ve only added the renameField line to confirm that MM is working.

                This is the URL for evo gallery module:
                /manager/index.php?a=112&id=3
                  • 33968
                  • 863 Posts
                  In ManagerManager you need to add the prefix ’tv’ to any template variable field you are referencing.

                  So assuming you called your link TV ’Gallery’, and the ID of the gallery is 3, you should have:
                  mm_galleryLink('tvGallery', '', '', '3');
                  


                  Also, I don’t know if having a space after the commas makes any difference but that’s how it is by default - try the above code
                    • 36926
                    • 701 Posts
                    Quote from: lucas at Jun 03, 2010, 05:22 AM

                    In ManagerManager you need to add the prefix ’tv’ to any template variable field you are referencing.

                    So assuming you called your link TV ’Gallery’, and the ID of the gallery is 3, you should have:
                    mm_galleryLink('tvGallery', '', '', '3');
                    


                    Also, I don’t know if having a space after the commas makes any difference but that’s how it is by default - try the above code


                    Thanks lucas, I thought the prefix was going to be the problem but I didn’t actually seem to solve the issue. The TV field still just seems to get hidden. I’m now using:
                    mm_renameField('introtext','Summary');
                    mm_galleryLink('tvGallery', '', '', '3');
                    


                    My TV is called ’Gallery’

                    Thanks

                    Ben
                      • 33968
                      • 863 Posts
                      Are you configuring the MM rules in the plugins/managermanager/mm_rules.inc.php file, or in a chunk? By default there is a chunk called mm_demo_rules or something similar provided with ManagerManager, you need to delete that if you are setting rules in the php file instead.

                      Otherwise, I’m not too sure where else to look I’m afraid!