Shuffling paginated records by page

3 posts by 2 authors in: Forums > CMS Builder
Last Post: January 1, 2014   (RSS)

Hi All,

I’m using
perPage,
$my_list_tableMetaData['totalPages'],  $my_list_tableMetaData['nextPage'] and
$my_list_tableMetaData['prevPages'] to paginate the number of images that appear on a results list page.

Full code is below

I’d like to shuffle the records returned, but only on each page and not globally, so that the records on page 1 are shuffled separately, and the records on page 2 are shuffled separately, etc..

Any suggestions?

Thanks,

Jerry Kornbluth

<?php // load records from 'my_list_table'
  list($my_list_tableRecords, $my_list_tableMetaData) = getRecords(array(
'tableName'   => 'my_list_table',
'perPage' => 25,
  ));
 ?>

There are <?php echo $my_list_tableMetaData['totalRecords']; ?> Listings<br />
<?php if ($my_list_tableMetaData['totalPages'] > 1): ?>

This is <?php echo $my_list_tableMetaData['page'] ?> of <?php echo $my_list_tableMetaData['totalPages'] ?></span>

<?php if ($my_list_tableMetaData['nextPage']): ?>
 <br />
<a href="<?php echo $my_list_tableMetaData['nextPageLink'] ?>">Click-Tap for more</a>
<?php endif ?>

<?php if ($my_list_tableMetaData['prevPage']): ?>
<br />
<a href="<?php echo $my_list_tableMetaData['prevPageLink'] ?>">Click-Tap for previous</a>
<?php endif ?>
<br />
<?php endif ?>

The first CMS Builder reference book is now available on-line!







Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php

Hi Damon,

Happy New Years wishes to you and all.

Thanks for looking at this.

 I assumed that it would will shuffle all records and not per page, and so never tried it.

You were right, it worked, and made sense.

Thanks

Jerry Kornbluth

The first CMS Builder reference book is now available on-line!







Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php