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

    I really need some help with outputting galleries.

    I don’t need anything complex, but I’m afraid I won’t be able to figure this out on my own. I dis some forum and Google crawling, but didn’t find anything similar.

    What I want:

    I will have approx 150 galleries and I want them all displayed, I understand that I will need to use this call: [[GalleryAlbums? &dir=`ASC`]]
    At the moment, when Using this call, all galleries are listed, with just their title, clicking on them doesn’t do nothing.

    1. I would like for galleries displayed like this:

                <div class="album">
                <h4>[[Gallery Name]]</h4>
                [[Gallery thumbnail]]
                <br /><span><strong>[[amount of]]</strong> images</span>
                </div>
    


    I learned that I need to edit galAlbumRowTpl, but I’m not sure what exactly to edit.


    2. After clicking on Gallery thumbnail, all thumbnails of clicked gallery appear. When I click on thumbnail bigger picture appears preferably with lightbox 2 or lytebox

    I tried reading through documentation, but it’s a bit too complex and while there are some great, easy to follow tutorials, I couldn’t find anything similar to my problem.

    I used easy2gallery and maxigallery in modx evolution before, which was way more easier smiley

    It would be really nice if some one could help me out.
      • 36461
      • 102 Posts
      Can no one help me with this ?

      I can’t figure this out from available documentation sad

      In modx evolution it was really easy with "Easy 2 gallery" but Revolution, has only 1 gallery plug-in.
        • 36461
        • 102 Posts
        Bump laugh
          • 23299
          • 1,161 Posts
          Hope you get help here. I am watching this thread.

          I could not get Gallery to function well in my Revo testing. Its the main thing that keeps me in the Evo camp. With Evo I use a mix of MaxiGallery, Evogallery, jQuerry (Fancybox) and all is good...
            • 36461
            • 102 Posts
            Thanks ! smiley

            It was so easy in EVO to output gallery exactly how I need.
            I just lack the knowledge to program output myself.

            Other than that REVO is really great smiley
              • 36461
              • 102 Posts
              Bump
                • 32098
                • 31 Posts
                Hi Wonderland. Any chance of a knowledge swap? I know haow to get a gallery going. Do you know how to give a new user permission to access the manager? I assumed the latter would be the easiest part of the whole process, but its got me completely stumped.

                About the gallery. This is only one gallery. It uses a snippet and one chunk to automatically display the images in a folder whose name is entered in a TV for the page that the gallery will appear on. One home-made snippet, one chunk, one TV.

                An example of the result appears here (but you could layout the photos any way you wanted):
                http://secure.sitesdns.com/~epablo/regions-in-spain-for-villa-holidays/liebana/liebana-villas/rocio-villa-liebana.html

                I already posted this to help the person struggling with multiple TVs for images. I will paste it in again here:

                ). I needed to get a gallery on the page and wanted a way to load the photos automatically so the client can just upload the photos to a folder and not worry about putting them on the page or assigning individual photos to separate TVs. It’s easy.

                First, make space for the gallery on your page template. I want the photos to line up in two columns in a sidebar on the right but have the first photo double width, so I deal with that separately (and I have decided that that photo will always be called main.jpg (the main photo in the folder)). So in the template I put this:


                <div id="gallery">
                      <ul><li><a href="photos/[[*photofolder]]/main.jpg"><img class="galleryphotobigger" src="photos/[[*photofolder]]/main.jpg" alt="[[*pagetitle]]" /></a></li>[[!gallerylist?&dir=`[[*photofolder]]`]]</ul>
                
                </div><!-- end gallery -->
                


                There I have one TV called photofolder which the client uses to specify the name of the folder with the photos for the gallery on this page (the folder is always a child of the parent "photos" folder). The rest of the items in the list are created by the gallerylist snippet. The name of the directory that the snippet will have to look for is passed to it in the dir variable.

                Here’s the little snippet which finds the photos and loads them via a chunk:

                $findme = 'main';
                $files = glob('photos/' . $dir . '/*.*');
                $output = '';
                for ($i=0; $i<count($files); $i++)
                {
                      $photo = $files[$i];
                      if(strpos($photo, $findme) === false) {
                            $output .= $modx->getChunk('fullgallerychunk', array(
                       'filename' => $photo,
                           ));
                }}
                return $output;
                


                My knowledge of PHP is utterly basic so that might not be the best way to do the job, but it works. It lists all the files (there must only be image files in the folder) except for the file entitled main.jpg. It outputs the name of the file to the filename placeholder in the chunk.

                Then you just need a tiny chunk for the images, like so:

                <li><a href="[[+filename]]"><img class="galleryphotosmall" src="[[+filename]]" alt="[[+filename]]" /></a></li>


                I hesitate to recommend stuff because I haven’t yet succeeded in getting my first Modx site off the ground, but I have got a little gallery going (and I like the Pirobox JQuery lightbox, which is so easy to plug into the above).

                Any good?

                If you know how to give a new user permission to access the manager, do please post a reply in the same part of this forum.

                All the best,

                Michael
                  • 5340
                  • 1,624 Posts
                  The Revo Gallery has been updated to be used with an album image.
                  See the revo docs. Place <img src="[[+image]]" alt=""/> in your Gallery album tpl