MODX Revo 专辑列表分页

MODX Revo album list pagination

我想使用 Gallery 为我的相册列表分页。 尝试使用 getPage 来完成。 对于相册中的照片,一切都完美:

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

但相册分页显示,但不起作用:

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

我做错了什么?

Gallery 不支持开箱即用的 getPage。你可以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

不过,我建议您查看 MoreGallery。它是额外收费的,所以不是免费的,但 support pagination 并且远远优于 Gallery imo。