We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 37449
    • 57 Posts
    grin grin

    Again, this is probably an easy one for someone, but I am now officially suffering from "gallery-blindness"!!

    I’d just like to be able to

    1. extract the latest image from any active gallery and display the thumbnail (eg in the sidebar of my Gallery Home page)
    2. extract the latest image from the current gallery and display the thumbnail (eg in the sidebar of the Album Viewer page)


    Gallery Home is a container, which has Album Viewer and Image Viewer as children.
    All 3 use a TV called galSide for the side-bar chunk.

    This is the chunk:
    <h4>Latest Image</h4>
    
    [[!If? &subject=`[[+LatestImage]]` &operator=`isempty` &then=`
    [[!Gallery? &checkForRequestAlbumVar=`false` &showInactive=`false` &toPlaceholder=`LatestImage` &useCss=`1` &containerTpl=`view-album-tpl` &thumbWidth=`130` &thumbHeight=`92` &thumbTpl=`view-item-tpl` &imageWidth=`800` &imageHeight=`800` &sort=`createdon` &limit=`1` &dir=`DESC`]]
    [[+LatestImage]]
    `
    
    
    &else=`
    [[!Gallery? &checkForRequestAlbumVar=`true` &showInactive=`false` &toPlaceholder=`LatestImage` &useCss=`1` &containerTpl=`view-album-tpl` &thumbWidth=`130` &thumbHeight=`92` &thumbTpl=`view-item-tpl` &imageWidth=`800` &imageHeight=`800` &sort=`createdon` &limit=`1` &dir=`DESC`]]
    
    [[+LatestImage]]
    `]]
    


    And this works fine for an album (ie. number 2) but not for the Gallery Home page.

    I feel *this* close to getting it sorted!!

    Any help greatly appreciated smiley

    Thanks in advance
    Daz



      formerly sumodaz on here!
      • 37449
      • 57 Posts
      Solved this one as well now!

      The Gallery snippet can’t have both &album and &tag blank - it just returns nothing.
      So, I tagged all the images with a generic "image" tag, and then used that to get the full image list.

      I don’t know if there is a way to use a wildcard on the tag, I tried all the usual combinations, but couldn’t see a way to do this. I’m guessing the snippet would need a mod in order to do this, but my PHP is sadly lacking!!

      grin
        formerly sumodaz on here!