Multi record display order

7 posts by 2 authors in: Forums > CMS Builder
Last Post: 3 hours ago   (RSS)

I have a multi record list and all the records are listed alphabetically in the CMS in the correct order but on the page they are not displaying in the same order. How can I fix this? This is the page: https://worthschool.co.uk/activities-clubs-societies/

Hi MercerDesign, 

In your getRecords() call you can add this option:

'orderBy'             => 'lastName DESC',         // optional, defaults to $_REQUEST['orderBy'], or table sort order

Just replace "lastName" with the column you want to sort on, and if you don't want it in descending (reverse) order, remove "DESC".  

Let me know if that works for you.

Dave Edis - Senior Developer
interactivetools.com

Thank you, this works up to articles that start with the letter "G", if you look at this page (https://worthschool.co.uk/activities-clubs-societies-test.php) and scroll down, it starts to go wrong from "G" onwards.

Hi MercerDesign,

Can you check when you view source on the page are the articles in the correct order there? 

Dave Edis - Senior Developer
interactivetools.com

Hi, yes they appear in order in the source code.

Hi MercerDesign, 

All PHP can do is generate the page source, so if they're in the correct order in the source, but not in the correct order when displayed, something is re-ordering them after the page is loaded.

I'd check any JavaScript libraries or CSS that might be overriding the order.  Or try temporarily disabling any CSS or JavaScript libraries to find the cause.

Hope that helps!

Dave Edis - Senior Developer
interactivetools.com