<![CDATA[ getPage: pagination returns empty 2nd page - My Forums]]> https://forums.modx.com/thread/?thread=74678 <![CDATA[Re: getPage: pagination returns empty 2nd page [SOLVED]]]> https://forums.modx.com/thread/74678/getpage-pagination-returns-empty-2nd-page#dis-post-424931
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);
} 
]]>
jobkingori May 26, 2012, 11:03 PM https://forums.modx.com/thread/74678/getpage-pagination-returns-empty-2nd-page#dis-post-424931
<![CDATA[Re: getPage: pagination returns empty 2nd page]]> https://forums.modx.com/thread/74678/getpage-pagination-returns-empty-2nd-page#dis-post-414745
This is my call (I also tried it with the standard call, same result, an empty second page):

[[!getPage? &elementClass=`modSnippet` &element=`getResources` &limit=`10` &parents=`10` &includeTVs=`1` &includeContent=`1` &tpl=`newsSummaryTpl` &tplLast=`newsSummaryTplLast`]]


All pages in the parent folder are visible.

It returns a total of 4 pages and that is exactly the amount of pages in the parent folder.

- MIM]]>
MIM Mar 05, 2012, 01:46 AM https://forums.modx.com/thread/74678/getpage-pagination-returns-empty-2nd-page#dis-post-414745
<![CDATA[Re: getPage: pagination returns empty 2nd page]]> https://forums.modx.com/thread/74678/getpage-pagination-returns-empty-2nd-page#dis-post-414214 opengeek Mar 01, 2012, 10:44 AM https://forums.modx.com/thread/74678/getpage-pagination-returns-empty-2nd-page#dis-post-414214 <![CDATA[getPage: pagination returns empty 2nd page]]> https://forums.modx.com/thread/74678/getpage-pagination-returns-empty-2nd-page#dis-post-414131
When I set the limit of my getPage call to limit=`10` and there are only 5 results to display the pagination gives me an empty second page. How can I prevent this?

I am using modx revo 2.2 and getPage 1.2.2

- MIM]]>
MIM Mar 01, 2012, 03:34 AM https://forums.modx.com/thread/74678/getpage-pagination-returns-empty-2nd-page#dis-post-414131