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)

1 Like

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

1 Like

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

Is this on webflow’s to-do? This is really counterintuitive and frustrating. I relied on this to work in the planning of a project. Please add this feature.

1 Like

There is a wishlist item, add your vote.

https://wishlist.webflow.com/ideas/WEBFLOW-I-637

Out of curiosity are your referenced items always sorted in a consistent way, or are you needing to control the specific ordering of the referenced items on each CMS record individually?

#1 could be solved using script, and I think Finsweet already has a CMS sorting script.

#2 could be solved through the CMS API, but you’d have to build your own tool for that.

Sorry to hear that @janwebflowforum , did you come up with a solution?

This is on Webflow’s wishlist (and there are other similar ones as well):

https://wishlist.webflow.com/ideas/WEBFLOW-I-547

This is an old post but highlighting these really good suggestions to work through the problem:

Have those helped you?

1 Like

Upvoted, thanks for the input! And good idea, I will try the finsweet script.

@matthewpmunger has there been any update/development on this in the past year? It would be very useful!

Has a fix to this been created yet? I really need to be able to filter my multi-reference collection items. It’s so strange to me that this isn’t even an option.

Still the same situation.

We usually sort or filter with script when needed, however with the native nested list design you’re stuck with 5 nested multi-ref items. That’s all that gets emitted into the page, so you can sort and filter, but only from those 5.

Your other option is to go with Finsweet’s CMS nest which pull the content from other pages and lists to assemble a combined view. With some learning how the tools are configured you should be able to overcome these UI limitations but possibly at a major performance hit, depending on how you set it up.

I was able to accomplish this using Finsweet. Here is the page with the directions I followed: