Getting the same error ... total results are three ...
I placed a placeholder [[+total]] ... on the first page it displays '3' on the next or any other it displays '4' but the navigation is not displayed. Any ideas?
The snippet has the limit and offset and built in and displays the results appropriately. In fact, the combination with getPage shows the correct results. i.e. If I click the navigation from the first page to go to the second page I get the second item and so on but its only the navigation that is not displayed
[[!getPage?
&elementClass=`modSnippet`
&element=`getWaabehAlbums`
&rowTpl=`getWaabeh.storeAlbumsTpl`
&pageVarKey=`page`
&totalVar=`total`
&limit=`1`
]]
[[!+page.nav:notempty=`
<div class="paging">
<ul class="pageList">
[[!+page.nav]]
</ul>
</div>
`]]
UPDATE
Figured the issue ... I had performed the getCount after the limit. Worked when I did this;
/* Get snippet properties and set the defaults */
$limit = $modx -> getOption('limit',$scriptProperties, 10);
$offset = $modx -> getOption('offset', $scriptProperties, 0);
// get total count of query
$total = $modx -> getCount($albumObject, $query);
// if limit or offset is set
if (($limit != 0) || ($offset != 0)) {
$query -> limit($limit,$offset);
}
[ed. note: jobkingori last edited this post 11 years, 11 months ago.]