We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 24393
    • 83 Posts
    seems a little overkill to me... this is my ditto template:
    <div class="item">
    	<div class="image">
    				[[EvoGallery? &display=`images` &type=`thumbnail` &picId=`0` &docId=`[+id+]` &limit=`1`]]
    	</div>
    	<div class="info">
    		<h3>
    			<a href="[~[+id+]~]">[+pagetitle+]</a>
    		</h3>
    	</div>
    </div>

      stevesunderland.com
      GRAPHICS | INTERACTIVE | MARKETING
      xhtml + ajax + seo websites powered by modx
      • 27421
      • 67 Posts
      Thanks Steve. You’re the man! grin I tried something similar to what you have and it works like a charm. Man, now I feel like an idiot for not coming to this solution on my own. Thanks again!
        • 4385
        • 372 Posts
        SOLVED!

        Galleries would not show up because they were filtered out! I am not sure why. It is hardcoded in the code to ignore containers.

        On line 88 of gallery.class.inc.php
        $filter = "published = '1' AND type = 'document' AND isfolder = '0' AND " . $docSelect . " hidemenu <= '" . $this->config['ignoreHidden'] . "'";


        I removed "AND isfolder = ’0’ " and now my galleries are working!
          DropboxUploader -- Upload files to a Dropbox account.
          DIG -- Dynamic Image Generator
          gus -- Google URL Shortener
          makeQR -- Uses google chart api to make QR codes.
          MODxTweeter -- Update your twitter status on publish.
          • 4385
          • 372 Posts
          I am using the 960 grid system, and I need to have an alpha class and an omega class at the beginning and end of each of my photo rows. I thought I could use "itemTplFirst" and "itemTplLast" to do this, but I need omega every forth thumbnail. So then I used "itemTplAlt" and called &itemAltNum=`4`, but then I needed alpha to start again. Here is my suggested fix.

          [!EvoGallery? &display=`galleries` &docId=`[*id*]` &type=`photobox` &itemAltNum=`4` &resetCount=`1` &sortBy=`sortorder` &gallerySortBy=`longtitle` &gallerySortDir=`ASC`!]

          I added resetCount to gallery.class.inc.php

          <br />93		    $count = 1;<br />94			[color=red]// reset first[/color]<br />95			[color=red]$first = 1;[/color]<br /><br /><br /><br />124    				if(!empty($item_tpl_first) && $count == [color=red]$first[/color]){<br />125        				$items .= $item_phx->Parse($item_tpl_first);<br />126    				} else if(!empty($item_tpl_last) && $count == $recordCount){<br />127        				$items .= $item_phx->Parse($item_tpl_last);<br />128    				} else if(!empty($item_tpl_alt) && $count % $this->config[’itemAltNum’] == 0){<br />129        				$items .= $item_phx->Parse($item_tpl_alt);<br />130						[color=red]if ($this->config[’resetCount’]){[/color]<br />131							[color=red]$first = $count+1;[/color]<br />132						[color=red]}[/color]<br />133    				} else {<br />134        				$items .= $item_phx->Parse($item_tpl);<br />135    				}<br />



          later again around line 206

            DropboxUploader -- Upload files to a Dropbox account.
            DIG -- Dynamic Image Generator
            gus -- Google URL Shortener
            makeQR -- Uses google chart api to make QR codes.
            MODxTweeter -- Update your twitter status on publish.
            • 4385
            • 372 Posts
            I think it would be nice to be able to limit galleries to certain templates. I trying to make this thing "client-proof". How about something like this?
            $filter = "WHERE c.template = '" . $templateId . "'";
            however this will flatten out the parent child structure.

            Is there a way to preserve it? If I do an "AND" I lose the children, since the parent does not have the same template ID.
              DropboxUploader -- Upload files to a Dropbox account.
              DIG -- Dynamic Image Generator
              gus -- Google URL Shortener
              makeQR -- Uses google chart api to make QR codes.
              MODxTweeter -- Update your twitter status on publish.
              • 27421
              • 67 Posts
              Has anyone had any luck getting pagination to work? I’m trying it with Ditto and it’s giving me the total number of docs, but the second page of results is coming up empty.
                • 22427
                • 793 Posts
                Hi all,
                in my first try of using EvoGallery I obviously have some misunderstanding and hope you can push me a bit into the right direction.
                I did the follwing:
                Into my ressource "Gallery" (id=7) I uploaded a bunch of image files, so now there exists a folder [tt]assets/galleries/7/[/tt] containing these files and a subfolder [tt]thumbs[/tt] with the corresponding thumb files.
                In the template for "Gallery" I put this call of EvoGallery:
                [[EvoGallery? &display=`images` &type=`simple-list` &itemTpl=`tpl_thumb`]]
                The template [tt]tpl_thumb[/tt] is this:
                <a class="thumb" href="[~15~]"><img src="[+thumbs_dir+][+filename+]" alt="[+title+]" title="[+title+]" /></a>
                I get my thumbs like I want them, styled by the class [tt]thumb[/tt].
                In the links the id=15 refers to a ressource "Photo page" I want to show the big images in; for it I use a special template containing the following EG call:
                [[EvoGallery? &display=`single` &itemTpl=`tpl_foto`]]

                Herein [tt]tpl_foto[/tt] is this chunk:
                <img class="foto" src="[+images_dir+][+filename+]" alt="[+title+]" title="[+title+]" />
                Because there is no [tt]&picId [/tt] parameter in the call, the output shows all the images of the gallery one after the other, styled as big images by the class [tt]foto[/tt].
                If I write a fix [tt]&picId[/tt] into the EG call, for example:
                [[EvoGallery? &display=`single` &picId=`44` &itemTpl=`tpl_foto`]]
                only this single picture is shown - but of course always the same, independent of the thumb link which was clicked.
                So my question is: What do I need to write into the [tt]&picId[/tt] parameter to get the image that corresponds to the clicked thumb? Must I add something in the link, like
                <a class="thumb" href="[~15~]?picId=????">
                That is, how do i transfer the picId of the clicked thumb into the "Photo page" (id=15)? In the EvoGallery Documentation I read:
                The ’single’ mode allows you to display a single image provided that you know the ID of it in the database. Generally, this information is determined through a separate snippet instance in ’images’ mode before passing it on to another instance. By default, this mode looks for a ’picId’ variable via a standard PHP request variable.
                Seeing the default value for [tt]&picId[/tt] in the parameter list I tried this:
                [[EvoGallery? &display=`single` &picId=`$_REQUEST['picId']` &itemTpl=`tpl_foto`]]
                But that didn’t work: No image is shown.
                You see, I’m rather clueless in PHP.

                And so I ask for your help.
                Thank you in advance!
                ottogal




                  • 22427
                  • 793 Posts
                  Reading my posting again it becomes clear to me that this
                  &picId=`$_REQUEST['picId']`
                  cannot work. Likely I need a snippet call, say
                  &picId=`[[getPicId]]`
                  and in the code of getPicId there should be used $_REQUEST[’picId’]. Am I right? I really have to learn a bit PHP...
                    • 4385
                    • 372 Posts
                    @ottogal

                    Is this what you are looking for?
                    <a class="thumb" href="[+images_dir+][+filename+]"><img src="[+thumbs_dir+][+filename+]" alt="[+title+]" title="[+longtitle+]" /></a>
                      DropboxUploader -- Upload files to a Dropbox account.
                      DIG -- Dynamic Image Generator
                      gus -- Google URL Shortener
                      makeQR -- Uses google chart api to make QR codes.
                      MODxTweeter -- Update your twitter status on publish.
                      • 22427
                      • 793 Posts
                      Okay, I report my little steps forward - and hope not to be boring.

                      I wrote a small snippet [tt]getPicId[/tt] with this code:
                      <?php
                      $pic_id = (int) $_GET['picId'];
                      echo $pic_id;
                      ?>
                      Calling it in the title attribute
                      title="[[getPicId]]"
                      in the [tt]tpl_foto[/tt] for the Photo page, hovering over the image, the correct value of the [tt]picId[/tt] is shown. But - of course - that doesn’t work in the [tt]tpl_thumb[/tt] , the Gallery page has no [tt]picId [/tt].

                      Now looking into the database I realized the existence of the placeholder [tt][+id+][/tt] - which for a single image should give the [tt]picId [/tt]!

                      So I changed the [tt]tpl_thumb[/tt] into this one:
                      <a class="thumb" href="[~15~]&picId=[+id+]"><img src="[+thumbs_dir+][+filename+]" alt="[+title+]" title="[+id+]" /></a>
                      (also using it in the [tt]title[/tt] attribute to check it easily).

                      At the first look this did it: Clicking on a thumb in the Gallery page would show the Photo page with the correct big image.

                      BUT:
                      If I go back to the Gallery page (using the back button of the browser) and click on another thumb there will be shown the same big image as before - obviously the page is fetched from the cache. Edit: Clearing the cache does not change this behaviour.

                      So what’s going wrong? What can I do?

                      Thanks for looking over my stuff...