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

    I am a new MODx user, so please bear with my ignorance. smiley
    Right now I am trying to convert the first of two gallery types of my static site to MODx.
    It’s the slimbox2 version with jQuery.
    I have learned a lot from reading here in the forum, and my first attempt is already OK.

    Now here’s my question:

    In my first attempt (10 thumbnails within the content page), I used &galleryPictureTpl=`slimbox2jQuery`

    <li>
    <a class="abc xyz" href="[(base_url)][+maxigallery.path_to_gal+][+maxigallery.picture.filename+]" title="[+maxigallery.picture.title+]" class="slimbox" rel="lightbox-[+maxigallery.picture.gal_id+]">
    <img src="[(base_url)][+maxigallery.path_to_gal+]tn_[+maxigallery.picture.filename+]" class="thumbnail" title="[+maxigallery.picture.title+]
    [+maxigallery.strings.click_to_zoom+]" alt="[+maxigallery.picture.title+] [+maxigallery.strings.click_to_zoom+]" />
    </a>
    </li>


    and called MaxiGallery with the chunk {{slimbox2call}}

    [!MaxiGallery? &galleryPictureTpl=`slimbox2jQuery` &max_thumb_size=`100` &max_pic_size=`0`!]


    that I put into my content page like this:

    <ul class="slimbox2gallery">
    {{slimbox2call}}
    </ul>


    It works like a charm, but now I would like to use _my own_ square thumbnails (already existing thumbnails), not those created by MG.
    Can anybody tell me how I have to change the above &galleryPictureTpl to achieve this?
    Let’s assume I have already uploaded my thumbnails (100px x 100px) to the gallery, naming them tn_pic001.jpg etc.

    Thanks a lot for any help!

      • 7923
      • 4,213 Posts
      You can just replace the thumbnails that maxigallery has created.. the files are in assets/galleries/<doc id>/ folder.

      Or if you want to have both, upload your thumbnails to some folder with the same filename that maxigallery has them and use a path like this in your galleryPictureTpl:

      <img src="[(base_url)]path/to/your/thumbnails/tn_[+maxigallery.picture.filename+]" ..

      Or you could use CSS to create show square thumbnails.. Or use phpThumb to generate square thumbnail images automatic. There’s instructions on how to do this in the information sticky topic.


        "He can have a lollipop any time he wants to. That's what it means to be a programmer."
        • 1996
        • 3 Posts

        What a great answer, thanks a lot!
        <img src="[(base_url)]path/to/your/thumbnails/tn_[+maxigallery.picture.filename+]"

        Doh, so easy, but I didn’t have the genius to come up with it grin
        Works like a treat.

        Using phpThumb is also a very good solution.
        I had of course read the sticky topic information and tried it before asking about my own thumbnails.
        But I wanted to test a solution for _my own_ thumbnails, too.

        Does anybody know (or suppose) if taking your own thumbnails is better _performance wise_ compared to using phpThumb?
        Right now I am just testing on my local machine, so I can’t realistically compare the two methods with regard to performance.

        BTW, it took me one frustrating hour before I realized that phpThumb doesn’t work with php 5.3.
        Then I fortunately found vhollo’s useful hint that you need a special "phpthumb php 5.3 fix":
        http://modxcms.com/forums/index.php/topic,40416.msg276423.html#msg276423
        Here’s the link to the phpThumb php 5.3 fix:
        http://sourceforge.net/tracker/index.php?func=detail&aid=2937928&group_id=106407&atid=643974
        With this fix, phpThumb works like a charm, too.

        I guess the link to the fix would be something useful for the sticky topic information?
        Give me a call if you would like me to add it there.

        Thanks again for your great answer!

          • 7923
          • 4,213 Posts
          Quote from: archer at Apr 30, 2010, 06:54 AM

          Does anybody know (or suppose) if taking your own thumbnails is better _performance wise_ compared to using phpThumb?
          phpThumb caches the thumbnails it generates when they are requested the first time, so there’s very minimal overhead.

          So for every other request, phpThumb checks that does the cache file exist and if yes, redirect to that. There is a setting in phpThumb to tell what the cache time is. I believe you can set it to never regenerate the cache, so performance wise it’s close to having your own thumbnail files in file system.

          Shouldn’t be an issue.


            "He can have a lollipop any time he wants to. That's what it means to be a programmer."
            • 1996
            • 3 Posts

            Quote from: doze at May 02, 2010, 03:38 PM

            ...so performance wise it’s close to having your own thumbnail files in file system.
            Shouldn’t be an issue.

            Good to know, thanks a lot for your answers!