Sorting Uploads

5 posts by 3 authors in: Forums > CMS Builder
Last Post: February 1, 2023   (RSS)

By Dave - January 30, 2023

Hi pacolvin, 

I notified no one responded to this post.  Did you figure it out?  If not I'll take a look.  Thanks!

Dave Edis - Senior Developer

By pacolvin - January 30, 2023

Hi Dave,

I have not figured this one out yet.  Any help would be greatly appreciated.


By Dave - January 30, 2023

Hi Phil, 

We might need a few tries, but I notice $uploads is defined but not used anywhere. 

The getRecords() function usually adds some extra fields to the uploads, but let's try looping over $uploads directly.

What if you replace:
<?php foreach ($member_section_meeting_minutesRecord['member_section_meeting_minutes'] as $index => $upload): ?>

<?php foreach ($uploads as $num => $upload): ?>

Let me know if that works for you.

Dave Edis - Senior Developer

By kitsguru - February 1, 2023

you are sorting month day year which will group first by month whch is OK if you only have one year of data. Since it is a string it sorts as a string not a date.

Change it to yyyy-mm-dd to get it in date order

Jeff Shields