Sorting a related records output in an arbitrary order

17 posts by 3 authors in: Forums > CMS Builder
Last Post: December 3, 2020   (RSS)

By Carl - September 3, 2020

I think one way you can solve the problem is to update your musician listings so they're sorted Alphabetically in the CMS Admin, and on the front-end wherever you're wanting to display the listings, you can re-retrieve the records using mysql_select and output the records by concert line-up order.

Carl

PHP Programmer

interactivetools.com

By gkornbluth - September 3, 2020

Hi Carl,

Thanks for thinking on this.

The sorting makes sense (to find the musician records for a specific concert).

Could you elaborate on the" re-retrieve the records using mysql_select and output the records by concert line-up order."

Not sure I know how to accomplish this part.

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 Carl - September 8, 2020

Try using this file and let me know if that solves the order output for the frontend aspect.

Carl

PHP Programmer

interactivetools.com
Attachments:

indexE-Test.php 14K

By gkornbluth - September 8, 2020

Thank you Carl,

I'm sure I'll have some questions when I look this over, (which unfortunately won't be until tomorrow..)

Jerry

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 Codee - December 2, 2020

Hey Jerry,

You've probably already figured the solution out but I thought I'd comment anyway. It's my understanding that the pillbox order default is going to be in the order that the musicians are entered into the system. That's why, I think Carl, was stating that re-entering them can correct that...but that's neither intuitive nor convenient. And every time you add a new musician you'll come across the same issue(s).  You can reorder them on the backend in the sorting tab but that may not produce the results you are wanting either as there are only so many options. Since these are concerts and each venue is probably going to have varying orders...at the same time dealing with changes up to the last minute, including adding/subtracting musicians...what if you created some new fields to pull the musicians into - such as Headliner(s),then fields for the next couple or supporting popular acts, then obviously local and less popular acts.  That way each of those fields can pull from the musicians section as appropriate.  We had to do this not only with some concerts, but applied the same principles to sponsors...the main sponsor, then supporting major sponsors, then not so major sponsors.  Sometimes during the same festival (which had a variety of events) the sponsors for each event during the festival were different. Does that make sense? Once we did that we had a LOT less issues and less problems with acts and with sponsors. Interestingly also was, after doing it this way, the next few years the various sponsors were competing (bringing in more $ to the festivals) to get that top spot.

Just some thoughts on approaching this from a different angle. 

By gkornbluth - December 3, 2020

Hi Codee,

Thanks for taking the time to elaborate.

Carl put together a plugin that allows the promoters to sort the pillbox entries in each record on the fly and that's worked out so far, but the headliner field is certainly an interesting twist.

Thanks again,

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