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

By sidcam - December 21, 2012

My MLS has a requirement that no one online can ever have access to more than 100 of their records at a time.  How do I limit my list view page so it only finds the first 100 records at any point in time (regardless of if it's being searched on or not).

Most real estate sites by the arrows that jump pages will say, "Your search returned X records, only the first 100 are displayed," when it goes over 100.

Thanks in advance for the help.


By gkornbluth - December 22, 2012 - edited: December 22, 2012

Hi Sid,

Try 'limit'     => '100',

in your viewer's load records call

You can also set up separate 100 record pages with previous and next links.

Look at your code generator and you should see the options you need. Then just paste code into your viewer as required.

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

By sidcam - December 22, 2012

Thank you for your assistance.  Unfortunately it doesn't work.  I get the following error:

getRecords(section) errors
Can't set both 'perPage' and 'limit' or 'offset' options at the same time, choose one!

The goal is to show 10-12 records on a page (with arrows when applicable) but limit the overall search results to 100 (plus notify the user when there were more than 100 so they keep searching and/or narrow their search criteria).

I believe the goal of this rule is to make it more difficult for datascraping.  Without it someone could set a bot to search the site with wide open criteria and just have it keep clicking on the next arrow until it scraped the whole DB.

Anyway, haven't quite figured out the way around this.

Thanks again though