Streaming live at 10am (PST)

CMS Collection Sort switch field then date bug?

Hey Webflowers

I am in the midst of creating some CMS fields to make it easier for my client to showcase the events she really wants featured on the frontpage. Consequently, I have added a featured switch field inside of the Events collection and sorted the list like this:


But something weird is happening. I want the sorting hierarchy to be like this:

  1. Events with switch turned on
  2. Events with the nearest date to today.

But with these settings, an event at March 21, 2021 shows up as the first item, even though I do have events closer than that to today and all the switches turned off.

I am stumped. Anyone else experiencing this?

Read-only

Hi @Davidlin_ch12

This is a known issue, where the Switch is a boolean and the default it is set to the first state of Null. However, what you are looking for is False and True.

It is actually a bug we are actively working on and hope to have a fix for it shortly. Just waiting on some code reviews to push it out.

In the meantime, if there are not many posts, you can turn on and then off again to activate the False state for the switch.

Please let me know if you have any other questions,

~ Happy Designing ~
Brandon

1 Like

I see, thanks for the swift reply @WebDev_Brandon! :smiley:

Just to be sure that I understand it correctly, we have to toggle the switch on and off on all the items to change the value to false and make the sorting order work correctly? What will happen if the client creates a new item and forgets to toggle this?

Right now at this time if the client doesn’t use the switch in the manner described, then it will revert to the current issue.

Unfortunately, Until the switch sorting issue is fixed, hopefully sooner rather than later, this is the current process.

1 Like