We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 34108
    • 66 Posts
    Hi guys, sorry if this is a dumb question but I just can't seem to find a simple solution (loads out there but none I can get working).

    I'm using Gallery here - http://qb.theworkingparty.com.au/explore/image-galleries/ - to display a list of all gallery albums on the site (still in development, excuse the mess).

    All I want to do is add pagination to this page so when there's more than, say, 21 albums, the pagination - 1 2 3 4 - etc shows up at the bottom of the page.

    Doing this for actual galleries is a synch, but I can't figure out how to do it for just albums.

    Anyone know how I can get this to work? A very big thank you in advance for any help you can give me.

    Thanks
    Harmony
      • 37684
      • 3 Posts
      Hello!
      I hope I am not late with my answer.
      To add pagination for GalleryAlbums I've just used this way:
      1. Create resource with name fotoalbums.
      2. Create some daughter resources for fotoalbums with names page_1_fotoalbums, page_2_fotoalbums.
      3. Use GetPages package. The chunk looks like this:
      [[!getPage? &element=`getResources` &parents=`[[*id]]` &tpl=`viewer-albums` &depth=`5` &limit=`1`&pageVarKey=`page` &includeContent=`1`]]
      [[!+page.nav]]

      4. The `viewer-albims` chunk looks like this:
      <div>
      [[+content]]
      </div>

      5. Use Gallery, GalleryAlbums and If packages. Chunk for first daughter resource (page_1_fotoalbums) looks like this:
      [[!GalleryAlbums? &toPlaceholder=`GalleryAlbums` &limit=`10` &albumCoverSort=`rank` &prominentOnly=`0` &rowTpl=`DemoGalAlbumRowTpl` &thumbWidth=`195` &thumbHeight=`140` &start=`0`]]
       [[!Gallery? &checkForRequestTagVar=`10` &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]] `]]

      6. Chunk for second daughter resource (page_2_fotoalbums) looks like this:
      [[!GalleryAlbums? &toPlaceholder=`GalleryAlbums` &limit=`10` &albumCoverSort=`rank` &prominentOnly=`0` &rowTpl=`DemoGalAlbumRowTpl` &thumbWidth=`195` &thumbHeight=`140` &start=`11`]]
       [[!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]] `]]


      Pay attention for folowing properties:
      limit=`10` start=`0` and start=`11`
      .
      [ed. note: slbass last edited this post 14 years, 6 months ago.]
        • 34108
        • 66 Posts
        Thanks for taking the time to reply slbass and share your code, it's appreciated smiley!