Running a LocomotiveCMS site? We can host and maintain it for you. Contact us →

Liquid API

Advanced usage

Using with_scope to filter multilple many_to_many entries

Say you have a model that has a many_to_many relationship with a categories model and you want to list entries that relate to categories A and B:

{% with_scope categories.all: "$and: ['A', 'B']" %}