We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 13622
    • 74 Posts
    Quote from: sharkbait at Jun 20, 2010, 01:49 PM

    i’m not 100% sure what you are trying to do ...maybe i’m wrong, but...

    Thanks Sharkbait...that’s a really good suggestion. I’ve tried your method as well. The way "Galleries" mode works is that it only spits out the 1st image of the gallery, which you then click on to access the other images. I need it display all the images from a gallery, but in "images" mode you can’t specify a parent container and have it automatically search down the tree. In Images mode, you must specify a document that has the gallery. I also tried using commas, but that returns a error.

    Here’s any example of what I’m doing (with no gallery currently): www.mercermarketing.com

    See how one thumbnail has many images related to that project. It’s only one page, and I don’t want to have people click on a gallery image and get taken to a page with all the images.

    What I did was setup a container in MODx called "Projects." Within there are documents for each project. I assigned a image TV so I can create my own thumbnail. I also assigned a EvoGallery to each project document.

    I’ve tried almost every method I can think of to achieve the output I need, but it really comes down to being able to use a Evo placeholder that has the ID of gallery. The only that that I can tell that outputs the gallery ID is the [+images_dir+] placeholder, but it has the full path.

    Thanks again for your help...

      • 18373 ☆ A M B ☆
      • 3,141 Posts
      I’ve tried almost every method I can think of to achieve the output I need, but it really comes down to being able to use a Evo placeholder that has the ID of gallery.

      In EvoGallery, the "galleries" are the actual documents. So, inside your Ditto call you can access [+id+] which is the document ID (and thus the gallery ID). If you want to return the ID within your Evogallery snippet, you should be able to access &docId.

      To access it within the snippet you’ll need to modify it a bit. Within ditto you can use the [+id+] placeholder.
        Mark Hamstra • Developer spending his days working on Premium Extras and a MODX Site Dashboard with the ability to remotely upgrade MODX and extras to make the MODX world a little better.

        Tweet me @mark_hamstra, check my infrequent blog at markhamstra.com, my slightly more frequent ramblings at MODX.today or see code at Github.
        • 26931
        • 2,314 Posts
        See how one thumbnail has many images related to that project. It’s only one page, and I don’t want to have people click on a gallery image and get taken to a page with all the images.
        jasonimani, guess a nested call would work ( it does, just checked it smiley )

        on the overview page:
        [!EvoGallery? &display=`galleries` &docId=`3` &itemTpl=`galleryItem` &sortBy=`sortorder`!]

        {{galleryItem}}
        <div class="galleryoverview">
        <a class="teaserimg" href="[+images_dir+][+filename+]" rel="lightbox[ [+id+] ]">
        <img src="[+images_dir+][+filename+]" alt="[+title+]" />
        </a>
        [[EvoGallery? &docId=`[+id+]` &display=`images` &type=`simple-list` &tpl=`gal-outer` &itemTpl=`gal-inner` &sortBy=`sortorder` ]]
        <p><strong>[+pagetitle+]</strong><br />
        [+introtext+] <a class="teaserlink" href="[~[+id+]~]">zur Galerie</a></p>
        </div>


        {{gal-outer}}
        [+items+]


        {{gal-inner}}
        <a href="[+images_dir+][+filename+]" rel="lightbox[ [+content_id+] ]"></a>


        this will add a list of related image-links to each gallery-overview image and group them by ressource id:
        rel="lightbox[ 23 ]" ...don’t know if the spaces are a problem though. // okay, i saw you don’t even group them with "lightbox" just e.g. rel="lindy" so you can delete that part from my example
          • 8790
          • 526 Posts
          Quote from: Mark at Jun 18, 2010, 03:01 PM

          I’d assume max size in the config file is max width or height, depending on which one is bigger.

          To trim thumbs to a square, try looking into CSS’s clip() property.... http://www.seifi.org/css/creating-thumbnails-using-the-css-clip-property.html

          oh..yes thank you!
          never used this one yet.. it helps. But this is not exactly what should be done.
          I build a gallery with images that won’t have all the same size and w/h ratio , this means I just can’t setup a maxsize that could be ok for all : the thumbs should be into a 402x376px box and must cover this size too ( I made some slide show with jQuery cycle + Fancybox that call the full size image)

          As the max size is for the width for "sreen copy" ratio image, I have to fix it to something very high to be sure all the thumbs will cover the full excepted area once "clipped". And it’s not possible to display them using some width ou height css rule, as this will made them uggly.

          As Evo uses phpthumb (is it ?) it should be quit "simple" for the dev to insert a couple of options (maxwidth or maxheigh, or crop) directly the thumbs creation process at upload.

            Schtroumpf Grognon - Grouchy Smurf
            ---------------------------------
            Faites pas attention.. - Don&#39;t pay attention
            http://www.dzi-neo.net
            • 26931
            • 2,314 Posts
              • 8790
              • 526 Posts
              oh yes I did.

              But
              please, have a look to my other post related to here:

              http://modxcms.com/forums/index.php/topic,50671.msg294716.html#msg294716

              May be you could help...
                Schtroumpf Grognon - Grouchy Smurf
                ---------------------------------
                Faites pas attention.. - Don&#39;t pay attention
                http://www.dzi-neo.net
                • 13622
                • 74 Posts
                Quote from: Mark at Jun 20, 2010, 04:43 PM


                In EvoGallery, the "galleries" are the actual documents. So, inside your Ditto call you can access [+id+] which is the document ID (and thus the gallery ID). If you want to return the ID within your Evogallery snippet, you should be able to access &docId.

                To access it within the snippet you’ll need to modify it a bit. Within ditto you can use the [+id+] placeholder.

                Good suggestion...the problem is because is that because the ditto call is on the homepage (id #1), and within that is the EvoGallery to the galleries, it for some reason only passes placeholders from id #1. Does that make sense? So if I put [+pagetitle+] as a placeholder in my Evo call it will only return "Webpage" because that’s the title of doc #1. It’s not returning the value from the individual gallery.



                Quote from: sharkbait at Jun 21, 2010, 01:42 AM

                jasonimani, guess a nested call would work ( it does, just checked it smiley )

                rel="lightbox[ 23 ]" ...don’t know if the spaces are a problem though. // okay, i saw you don’t even group them with "lightbox" just e.g. rel="lindy" so you can delete that part from my example

                Sharkbait...that’s an interesting idea. I hadn’t thought of it. And it’s very close...the one problem is that because your making two calls to the same gallery, it returns the 1st image twice.

                What I did to remove the first item, is for the 2nd "images" call, I created a itemTplFirst template with almost nothing in it: "&nbsp;".

                I may just give up on the custom thumbnail idea, and use PHP thumb to create the properly sized images.

                Great ideas! Thanks for the help!


                  • 13622
                  • 74 Posts
                  Quote from: sharkbait at Jun 21, 2010, 01:42 AM

                  jasonimani, guess a nested call would work ( it does, just checked it smiley )

                  Hi Sharkbait,

                  That was it...I just realized what I was looking for was: [+content_id+]. It’s an unmentioned placeholder in the EvoGallery documentation.

                  Unlike the solution above, which is great if you use automatic thumbnail generation, but you also need to fill in every Title tag for each image.

                  This is method I used to used to grab the thumbnail I generated, and the pagetitle and place it as a title of the image. I could even take it a setup further, and use PHx to determine if a title page exists in Evo, and if not default to the page title.

                  Here is my code:
                  [!Ditto? &startID=`2` &tpl=`projectsTemplate` &orderBy=`ASC`!]

                  projectsTemplate:
                  <div class="example">
                  [[EvoGallery? &docId=`[+id+]` &display=`images` &type=`simple-list` &itemTpl=`projectGalleryItem` &itemTplFirst=`projectGalleryItemFirst` &sortBy=`sortorder`]]
                  </div>

                  projectGalleryItemFirst:
                  <a href="[+images_dir+][+filename+]" title="[[GetField? &docid=`[+content_id+]` &field=`pagetitle`]]" class="sample" rel="[+content_id+]">[[GetField? &docid=`[+content_id+]` &field=`projectThumbnail`]]</a>

                  projectGalleryItem:
                  <a href="[+images_dir+][+filename+]" title="[[GetField? &docid=`[+content_id+]` &field=`pagetitle`]]" class="sample" rel="[+content_id+]"></a>

                  Thanks again...I would not have been able to figure this out without your (and everyone’s) help. I really appreciate it.
                    • 26931
                    • 2,314 Posts
                    pleasure smiley

                    found out (by looking at the db table) that [+content_id+] is the actual ressource id used in that table...and [+id+] is actually used to iterates all images. ...in gallery-view, [+id+] will return the ressource id as we are used to.
                      • 13622
                      • 74 Posts
                      Quote from: sharkbait at Jun 21, 2010, 01:03 PM

                      pleasure smiley

                      found out (by looking at the db table) that [+content_id+] is the actual ressource id used in that table...and [+id+] is actually used to iterates all images. ...in gallery-view, [+id+] will return the ressource id as we are used to.

                      Very cool...I would have never thought to check the DB tables. So again thanks...! I just pushed the changes up...works great.