Streaming live at 10am (PST)

Filter CMS list with "or" instead of just "and"?


#1

Currently, you can select multiple filters, but it functions only as an “and” condition.

For example, let’s say you have a blog, and at the bottom of each post you want “related posts”. You want to list posts that are by the same author OR on the same topic. However, if you set two filters, it will only show posts by the same author AND on the same topic.

This is frustrating because, in my limited amount of coding knowledge, it shouldn’t be difficult to have a “||” condition instead of a “&&” condition. I imagine there must be a simple way to do this with custom code, but still too complicated for me.


#2

IS ANYBODY OUT THERE!? https://www.youtube.com/watch?v=H0g9Bn0RIgg

lol


#3

:wave: Yo Ha! I feel ya. Best to work within the constraints for now. So just drop in two instances of the collection and apply the different filter to each. Does the trick and normally the separation works well. I’m doing he same on a product page.

This might not be the answer you want, but at least you feel less alone


#4

Good idea. I believe that would work only if you have CMS items listed vertically, but if they are horizontal (say, 3 a row) it won’t work.


#5

It works either way unless I am missing your point. Cheers


#6

It wouldn’t work because if you have 3 items in a row, and one collection has 2 items that meet the criteria, the next collection would still be below rather than filling in the missing spot above.


#7

@MichaelMannucci, there is a workaround for this.

You can create a collections filter for what you are trying to do. It could work like this:

https://the-gate-of-heaven.webflow.io/articles

This is a site still in design, but if you click on anyone of the categories (or topics) you can see what is filtered.