<p>Use the <a href="https://craftcms.com/docs/relations#the-relatedTo-param" rel="nofollow">relatedTo</a> method and pass an array using the <code>and</code> parameter.</p>

<pre><code> {% set venueEventType = craft.request.getParam('catVenueEventType') %}
 {% set venueEventSize = craft.request.getParam('catVenueEventSize') %}

 {% set entries = craft.entries.section('venues').relatedTo(['and', venueEventType, venueEventSize]) %}
</code></pre>

CC BY-SA 3.0
2016-10-23T09:24:08.440Z
2016-10-23T09:24:08.440Z
Richard Frank
<p>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?</p>

<entries><search>
Simple search using two categories
# Simple search using two categories

(Asked by: username_0 on 2016-10-23)

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?

**Tags:** entries, search

---

## 1 answers

### Answer by username_0 on 2016-10-23. Score: 3

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]) %}


---

