Pagination Errors

4 posts by 2 authors in: Forums > CMS Builder
Last Post: December 22, 2007   (RSS)

Re: [rasbro] Pagination Errors

By Dave - December 21, 2007

Hi Brian,

Ok, a few things. You shouldn't have an urls with "/page#" repeating on the end. If after upgrading to the latest version that still happens let us know. It doesn't cause problems but it looks nicer if it doesn't repeat.

Next, to answer your question. Not only will the results of page 2 change if you the perPage value does. They'll also change as you add and remove records. Just like when you bookmark a page of results from google what's on the page will change.

But, it should be pretty easy to have it do just about anything you like. You could have it display an error message when there is no page (like it does now), redirect to page 1 or some other page, or something else.

What would you like it to do?
Dave Edis - Senior Developer
interactivetools.com

Re: [Dave] Pagination Errors

By rasbro - December 21, 2007

My only concern was regarding errors when a page is not found. I understand that content on a page will change as products are added and removed. I will upgrade and then test again to see how it handles the changes to the perPage option.

If you do have suggestions for a way to make a missing list result page redirect to the default page 1, I would be greatful.

Thanks,
Brian

Re: [rasbro] Pagination Errors

By Dave - December 22, 2007

Sure, we're going to make this the default for the next version (v1.06), but here's some instructions if you want that feature right away:

- upgrade to v1.05
- replace the following with attached files:
/lib/viewer_functions.php
/lib/menus/database/showViewerCode_functions.php
- either generate your list viewer code again or replace the "no record were found" code with this:

<?php if ($listDetails['noRecordsFound']): ?>
No records were found!<br/>
<?php endif ?>

<?php if ($listDetails['invalidPageNum']): ?>
Results page not found,
<a href="<?php echo $listDetails['firstPageLink'] ?>">start over &gt;&gt;</a>.<br/>
<?php endif ?><br/>


That will make it easy for users to get back to the first page. To auto redirect just use a meta redirect tag or javascript with $listDetails['firstPageLink'] as the url.

Hope that helps!
Dave Edis - Senior Developer
interactivetools.com