Streaming live at 10am (PST)

How to sort and filter "multi-reference" collection items?

There’s no option for me to sort and filter “multi-reference” collection items.


Here is my public share link: LINK
(how to access public share link)

Hey @akshayhallur

That is not currently possible to sort or filter multi-reference lists within the list settings. For now arranging and selecting the referenced items in the CMS editor is the only native way to do this.

A work around could be to add another multi-reference field to the collection settings and in each multi-ref field setup the items and order that is desired.

Our team is aware of this and other limitations with the CMS and laying foundations to improve this. Other options are to check out community tools to add on top of Webflow for extended functionality. I’ll link to those below.

Hope that answers your questions.

Cheers,
—Matthew

Can you please elaborate on this?

Glad to.

In the settings for the CMS Collection, add another multi-reference field to the Related Templates collection. Then in the new field, add the same or different items in a different order based on what you would have done with conditional visibility or sort.

As I said, it is a workaround and not ideal, but it would be a way for yourself or other collaborators to control the references manually.

Is that clearer? If not, please share a Read-Only link for the project if you can. Then I’ll be able to clearly show it.

Cheers,
—Matthew

I don’t think this workaround really works because it’s not even reasonably possible to edit the order of items in a multireference field. Once items are entered, they are frozen–can’t even be dragged in the list in the CMS editor. When next month I want to add a new item to the multireference list and put it anywhere but after the last item, I have to delete all the items and start over.

The only workaround I have found to be reasonable is to add a reference or multireference field in the collection you want to refer TO (call it B) and refer to the first collection (the one you want to have the references listed in–call it A) in that one. So basically make the reference link backwards. Then you can add a CMS list in your collection A page, point it to collection B, and filter by “reference contains current collection”. Then filter and sort the displayed results as desired.

The downsides are (a) this data structure is completely backwards and very confusing when you want to maintain it later, and (b) you can’t do things like conditional visibility of the list (e.g. visible only if there are any references to collection B), requiring further weird hacks if you need that. So really it’s far from ideal, and the whole inability to order and sort multireference lists needs to be fixed properly. It’s clear they were designed as if the only use for them are a few tags in any old order, but that’s only a very limited use case, so it’s a bit baffling.

2 Likes