We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 35986
    • 46 Posts
    Gallery ver 1.2.1
      • 5340
      • 1,624 Posts
      2 things you should try to do:

      1. Test the if snippet on it’s own and see if it works properly. Same for gallery
      2. Upgrade to the latest. The demo uses MODX Revolution 2.1.0-rc4 (traditional) IF 1.1 and Gallery 1.0.2 so I can’t comment on the latest versions
        • 35986
        • 46 Posts
        thanks. i can’t see anything wrong with my setup so i might just rebuild with the specific versions that you used for the tut. I was hesitant to do this because I really wanted to take advantage of the GalleryAlbumList custom TV that was included with the 1.2.0 version changes. Ideally i’d like to be able to do this with the latest versions of everything... Really wish the new version of Gallery came with new instructions (spent 2 days trying to cobble this together :’()... Thanks cipa. If anyone has any ideas i’m all ears.
          • 5340
          • 1,624 Posts
          I just remembered I recently set up a site using the latest and it works

          Here’s the code I use

          [[!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]]
              
          `]]
          


          It should be the exact one from the demo. So maybe you need to upgrade. I remember there was a tag parsing MODX bug. Maybe that’s your problem.

          Regards
            • 35986
            • 46 Posts
            well the heart of the issue is that the placeholders that are supposed to catch the [[!Gallery?...]] and [[GalleryAlbums?...]] snippet calls, which are within the IF call (as the conditional argument), aren’t being output. If I take the placeholders — i believe mine are: [[+gallery]] and [[+galleries]] — out of the IF clause, the snippets are both output to the page (which I obviously don’t want either). The root of the problem seems to be the IF... Maybe it’s handled differently by this version of Gallery... damn this is a challenge.
              • 35986
              • 46 Posts
              held off on degrading the versions... playing with the code i decided to eliminate the IF call, figuring perhaps a latter version of the Gallery snippet made it redundant (which would also eliminate the need for the placeholders). Got a step closer with that. I’m getting a album thumb that leads to a gallery, the only thing is that the album thumb persists... Maybe we do need the IF? Here’s the full Gallery call:

              [[!GalleryAlbums? 
                &checkForRequestTagVar=`1`
                &limit=`0` 
                &albumCoverSort=`rank` 
                &thumbWidth=`142` 
                &thumbHeight=`142`]]
              
              [[!Gallery?
                &thumbTpl=`cboxItemThumb`
                &thumbWidth=`142`
                &thumbHeight=`142`]]
              
                • 5340
                • 1,624 Posts
                held off on degrading the versions...


                Why not upgrading?
                  • 35986
                  • 46 Posts
                  i have all the latest versions of Revo, IF, and Gallery... i was going to degrade each to the versions used in the specified tutorial (hesitant about downgrading Revo). For now i’m still trying to get the latest versions working together.
                    • 5340
                    • 1,624 Posts
                    I’m sorry to hear that IF is not working for you. could it be a cache problem.

                    Can you play with Cacheable checkbox and test in both cases. Also remove the ! from the snippet calls.

                    Another thing I would is create 2 simple snippets: Test1 and Test2 and use them like

                    [[!Test1 &toPlaceholder=`test-1`]]
                    [[!Test2 &toPlaceholder=`test-2`]]

                    [[!If? &subject=`[[+test-1]]` &operator=`isempty` &then=`

                    [[+test-2]]

                    ` &else=`

                    [[+test-1]]

                    `]]




                      • 35986
                      • 46 Posts
                      i’m PHP illiterate... what would i put in those two snippets?