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

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

Hi Carl,

Thanks for the sample test page.

I'm sure that you have a path that you're following with this approach.

I stripped out some extraneous code from the tests and re-sorted the records so that the last concert still shows, and your code for the page at https://greenwichvillagefolkfestival.org/indexF-Test.php seems to work the same way that the code in https://greenwichvillagefolkfestival.org/indexD.php does, but yours certainly seems a bit more straight forward.

I'm still at a loss though as to how to re-sort and add or subtract musicians (pills in the pillbox) for a specific show lineup.

As I mentioned previously, even though this project is a labor of love for me, I'm willing to entertain paying for the ability to resort any pillbox entries sitewide, and to be able to add or subtract specific 'pills' anywhere in the pillboxes.

If it's at all possible, I'd like to be able to button this up before the lineup for the next concert comes up in a little less then 2 weeks.

Again, thanks for this,

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 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. 

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