Record Sort By Questions

5 posts by 2 authors in: Forums > CMS Builder
Last Post: September 17, 2012   (RSS)

Re: [shawnpatoka] Record Sort By Questions

By gregThomas - September 14, 2012

Hi,

There is a simple way to do this. You just need to pass over a orderBy variable in the URL with the column you want the data sorted by from the table. So you could have some links or a form at the top of your page that will pass over the order. Maybe something like this:

<!-- Assuming the zip code table column is called zipCode -->
Sort By: <a href="?orderBy=zipCode" >Zip Code</a>


If your using a getRecords function to get the data from the table, it should then order them by the column you passed in the URL automatically.

Thanks!
Greg Thomas







PHP Programmer - interactivetools.com

Re: [greg] Record Sort By Questions

By shawnpatoka - September 17, 2012

Thank you very much, that was exactly what I was looking for for the alphabetical sort. But is there any way I can have like a search field, and someone could type in their zipcode, and it would display only the results that are in X radius of that zipcode?

Re: [shawnpatoka] Record Sort By Questions

By gregThomas - September 17, 2012

Hi,

This isn't a feature that comes as standard with CMS Builder, but there is a geocoder addon you can buy that will provide this exact function:

http://www.interactivetools.com/add-ons/detail.php?Geocoder-1034

Thanks
Greg Thomas







PHP Programmer - interactivetools.com

Re: [greg] Record Sort By Questions

By shawnpatoka - September 17, 2012

kk, sounds good. thanks for your help