We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 35986
    • 46 Posts
    How and where does one specify a parent for each gallery album? I’m going to have many resources, each of which will house several albums. what’s the best logic for setting this up? Bearing in mind that i don’t want to have my client to have to enter any code (e.g. a snippet call per each resource...). Thanks so much for any guidance. BTW i already have my gallery template with colorbox up and running.
      • 32858 ☆ A M B ☆
      • 2 Posts
      I think you can create a TVs for your template (which are used by parent resources), this TVs holds the albumIDs to be displayed on each resource. Then you can use LOOP snippet to display all albums under the parent resource (or you might write a snippet to get the TVs, explode the "," then runSnippet().

      There’s more simple solution for this, you can use &tag=`something` on [[Gallery]] to display album with specific tag (which I’m using here like a parent name). You can use textinput TVs to process the tag. You might want to give more specific infos about what you’re gonna do if you need some further help.
        • 35986
        • 46 Posts
        Hey. Got it. Thanks. But another problem: The code i have set up in my gallery template [em]refuses[/em] to show the album cover thumb and let me link thru to the actual gallery. it shows both the album cover AND the gallery. it’s driving me crazy. i have a feeling that it’s because i’m using the newest version of Gallery and consulting an outdated tutorial, perhaps making the IF snippet call obsolete, or an unnoticed bug in the latest Gallery... But i’ve followed the guides faithfully. Here’s my template’ snippet call:

        [[!Gallery?
          &toPlaceholder=`gallery`
          &thumbTpl=`cboxItemThumb`
          &thumbWidth=`142`
          &thumbHeight=`142`]]
        
        [[!GalleryAlbums? 
          &toPlaceholder=`galleries`
          &limit=`0` 
          &albumCoverSort=`rank` 
          &thumbWidth=`142` 
          &thumbHeight=`142`]]
        
        [[!If? 
          &subject=`[[+gallery]]` 
          &operator=`isempty` 
          &then=`[[+galleries]]` 
          &else=`[[+gallery]]`]]
        


        any help greatly appreciated. Thanks.
          • 35986
          • 46 Posts
          sorry, let me amend the above comment. that code returns absolutely nothing. this one returns both the album thumb and the gallery:

          [[!Gallery?
            &toPlaceholder=`gallery`
            &thumbTpl=`cboxItemThumb`
            &thumbWidth=`142`
            &thumbHeight=`142`]]
          
          [[+gallery]]
          
          [[!GalleryAlbums? 
            &toPlaceholder=`galleries`
            &limit=`0` 
            &albumCoverSort=`rank` 
            &thumbWidth=`142` 
            &thumbHeight=`142`]]
          
          [[+galleries]]
          
          [[!If? 
            &subject=`[[+gallery]]` 
            &operator=`isempty` 
            &then=`[[+galleries]]` 
            &else=`[[+gallery]]`]]
          


          i see how everything should work but the IF snippet doesn’t seem to be doing a damn thing >:(
            • 32858 ☆ A M B ☆
            • 2 Posts
            Hey, I’m not sure that I can follow up your problem, is it running at the moment? IF statement just does a pure return of the inputs and not process them (no matter what it is).
            I think I’ve been using Gallery for not too long ago, and perhaps I’m using the latest version of it.
            Are you gonna setup the basic gallery as the tutorial?
              • 35986
              • 46 Posts
              ok. didn’t know that IF snippet didn’t also process the input... that clears that up... all i’m trying to do is to get this result: http://modxrules.com/new/demo/jail-modx-revolution-photo-gallery.html. this is the snippet call that the author of that page has suggested:

              [[!GalleryAlbums? &toPlaceholder=`GalleryAlbums` &limit=`0` &albumCoverSort=`rank` &prominentOnly=`0` &rowTpl=`DemoGalAlbumRowTpl` &thumbWidth=`195` &thumbHeight=`140`]]
              
              [[!Gallery? &checkForRequestTagVar=`1` &toPlaceholder=`Gallery` &useCss=`0` &containerTpl=`DemoGalleryAlbumTpl` &thumbWidth=`195` &thumbHeight=`140` &thumbTpl=`DemoGalItemThumb` &imageWidth=`800` &imageHeight=`800`]]
              
              [[!If? &subject=`[[+Gallery]]` &operator=`isempty` &then=`
              
              [[+GalleryAlbums]]
              ` &else=`
              [[+Gallery]]`]]
              


              so what the hell am i doin’ wrong? when i use this code, i get no return at all. but when i put the placeholders in, as in my last comment, i get both the album cover and the gallery that its supposed to link thru to...
                • 35986
                • 46 Posts
                to clarify, i meant that both the gallery and the album cover are being shown on the same page. (obv. dont want that)...
                  • 5340
                  • 1,624 Posts
                  Are you running the latest Revo, Gallery and IF?
                    • 35986
                    • 46 Posts
                    Modx Revo 2.1.1. if ver 1.1. thanks

                      • 35986
                      • 46 Posts
                      here’s my template:

                      <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
                      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
                      <html xmlns="http://www.w3.org/1999/xhtml">
                      
                      <head>
                      
                      <title>[[++site_name]] - [[*pagetitle]]</title>
                      <base href="[[++site_url]]" />
                      
                      <link rel="stylesheet" href="[[++site_url]]assets/css/hp.css" type="text/css" media="screen" />
                      <link rel="stylesheet" href="[[++site_url]]assets/css/imgGrid.css" type="text/css" media="screen" />
                      <link rel="stylesheet" href="[[++site_url]]assets/css/colorbox.css" type="text/css" media="screen" />
                      <link rel="stylesheet" href="[[++site_url]]assets/css/reset.css" type="text/css" media="screen" />
                      
                      <script src="[[++site_url]]assets/js/wfJs.js" type="text/javascript"></script>
                      <script src="[[++site_url]]assets/js/_scriptaculous/prototype.js" type="text/javascript"></script>
                      <script src="[[++site_url]]assets/js/_scriptaculous/scriptaculous.js" type="text/javascript"></script>
                      
                      <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js"></script>
                      <script src="[[++site_url]]assets/js/jquery.colorbox.js" type="text/javascript"></script>
                      <script src="[[++site_url]]assets/webapps/jail/jail.min.js" type="text/javascript"></script>
                      
                      <script>
                        jQuery(document).ready(function(){
                        jQuery('.gal-item img').asynchImageLoader({placeholder : "assets/webapps/jail/_img/loading-thumb.gif"});
                        jQuery("a[rel='galerie']").colorbox();});      
                      </script>
                      
                      <script>
                        $.noConflict();
                      </script>
                      
                      </head>
                      
                      <body>
                      
                      <div id="pageid" class="content">
                      <div id="header">
                      [[$pageHeader]]
                      </div>
                      <div id="main" class="clearfix">
                      <div class="block1 clearfix">
                      <div class="block1-left">
                      
                      <div class="accordion">
                      <h3>BROWSE CATEGORIES</h3>
                      
                      [[Wayfinder? 
                        &startId=`84` 
                        &level=`2` 
                        &outerTpl=`wfOuter` 
                        &innerTpl=`wfInner` 
                        &parentRowHereTpl=`wfParentRowHere` 
                        &parentRowTpl=`wfParentRow` 
                        &activeParentRowTpl=`wfParentRowHere`]]
                      </div></div>
                      
                      <div class="block1-right">
                      <h3>[[*pagetitle]]</h3> 
                      
                      [[!Gallery?
                        &toPlaceholder=`gallery`
                        &thumbTpl=`cboxItemThumb`
                        &thumbWidth=`142`
                        &thumbHeight=`142`]]
                      
                      [[!GalleryAlbums? 
                        &checkForRequestTagVar=`1`
                        &toPlaceholder=`galleries`
                        &limit=`0` 
                        &albumCoverSort=`rank` 
                        &thumbWidth=`142` 
                        &thumbHeight=`142`]]
                      
                      [[!If? 
                        &subject=`[[+gallery]]` 
                        &operator=`isempty` 
                        &then=`[[+galleries]]` 
                        &else=`[[+gallery]]`]]
                      
                      </div></div>
                      
                      [[$pageFooter]]
                      </body>
                      </html>
                      


                      Here’s my chunks:
                      cboxItemThumb
                      <div class="[[+cls]]">
                      <a href="[[+image]]" rel="galerie" title="[[+name]]">
                      <img data-href="[[+thumbnail]]" class="[[+imgCls]]" src="[[+thumbnail]]" alt="[[+name]]" width="142" height="142"/>
                      </a>
                      </div>​
                      


                      galAlbumRowTpl
                      <div class="albumPreview">
                      <div class="thumb">
                      <a href="[[~[[*id]]? &[[+albumRequestVar]]=`[[+id]]`]]"><img src="[[+image]]" alt="[[+name]]"/></a>
                      </div>
                      <div class="desc">
                      <p>[[+description]]</p>
                      <a href="[[~[[*id]]?&[[+albumRequestVar]]=`[[+id]]`]]" class="view">View gallery</a>
                      </div>
                      </div>
                      


                      galItemThumb
                      <div class="[[+cls]]">
                      <a href="[[+linkToImage:if=`[[+linkToImage]]`:is=`1`:then=`[[+image_absolute]]`:else=`[[~[[*id]]?
                         &[[+imageGetParam]]=`[[+id]]`
                         &[[+albumRequestVar]]=`[[+album]]`
                         &[[+tagRequestVar]]=`[[+tag]]` ]]`]]">
                      <img class="[[+imgCls]]" src="[[+thumbnail]]" alt="[[+name]]"/>
                      </a>
                      </div>
                      


                      appreciate any guidance at all...