I have a venue search tool which has two categories - event type and event size. How do I create an entries loop that returns entries that have both categories assigned?
1 Answer
Use the relatedTo method and pass an array using the and
parameter.
{% set venueEventType = craft.request.getParam('catVenueEventType') %}
{% set venueEventSize = craft.request.getParam('catVenueEventSize') %}
{% set entries = craft.entries.section('venues').relatedTo(['and', venueEventType, venueEventSize]) %}