Search code examples
modxmodx-revolution

MODX Revo album list pagination


I want to make pagination for my albums list using Gallery. Trying to do it with getPage. For photos inside album all works perfect:

[[!getPage?
        &element=`Gallery`
        &limit=`8`
        &album=`portfolio`
        &totalVar=`gallery.total`
        &thumbWidth=`180`
        &thumbHeight=`150`
        &containerTpl=`NewGalleryAlbumTpl`
        &thumbTpl=`NewGalItemThumb`
        &cache=`0`
        &cache_expires=`0`
        &pageNavVar=`page.nav`
    ]]
<div class="system-nav-orange">
<span class="pages">Page [[+page]] from [[+pageCount]]</span>
<ul class="pager">
[[!+page.nav]]
</ul></div>
<div class="clear"></div>

but for albums pagination shows, but doesn't work:

    [[!getPage?
        &element=`galleryalbums` 
        &rowTpl=`rowTpl`  
        &pageNavVar=`page.nav` 
        &limit=`1`]]
<div class="system-nav-orange">
<span class="pages">Page [[+page]] from [[+pageCount]]</span>
<ul class="pager">
[[!+page.nav]]
</ul></div>
<div class="clear"></div>

What am I doing wrong?


Solution

  • Gallery does not support getPage out the box. You can edit the source code but not very future proof. There is also a possible work around which doesn't require code changes: https://forums.modx.com/thread/37769/revolution-gallery---how-to-add-pagination?page=2#dis-post-439685

    However I would recommend looking at MoreGallery. It's a premium extra so not free but does support pagination and is far superior to Gallery imo.