<p>When using an <a href="https://craftcms.com/docs/entries-fields" rel="nofollow">Entries field</a>, you're "relating" the entry to other entries.
The <a href="https://craftcms.com/docs/templating/elementcriteriamodel" rel="nofollow">ElementCriteriaModel</a> parameter to filter by related entries is the <a href="https://craftcms.com/docs/relations" rel="nofollow"><code>relatedTo</code></a> parameter.</p>

<p>Something like this should do the trick:</p>

<pre><code>{% set params = {
    section: 'events',
    order: 'eventShowtime desc',
    relatedTo: venueId
} %}
</code></pre>

CC BY-SA 3.0
2016-01-26T17:29:36.050Z
2016-01-26T17:29:36.050Z
carlcs
<p>I'm trying to work out how to query some channel posts (events) that take place at a certain venue.</p>

<pre><code>{% set params = {
    section: 'events',
} %}
</code></pre>

<p>I have a 'eventVenue' field in my events section which is an entries field powered by a channel called venues. I want to query by venue ID?</p>

CC BY-SA 3.0
2016-01-26T17:15:13.650Z
Thank you, that solves the date issue. Any idea how to query by venue id?
Shealan
<entries><elementcriteriamodel><entries-field>
Display events that appear at certain venue
# Display events that appear at certain venue

(Asked by: username_0 on 2016-01-26)

I'm trying to work out how to query some channel posts (events) that take place at a certain venue.
{% set params = {
    section: 'events',
} %}

I have a 'eventVenue' field in my events section which is an entries field powered by a channel called venues. I want to query by venue ID?

**Tags:** entries, elementcriteriamodel, entries-field
> **Comments:**
> **username_0**: Thank you, that solves the date issue. Any idea how to query by venue id?  

---

## 1 answers

### Answer by username_1 on 2016-01-26. Score: 1 | Accepted answer

When using an Entries field, you're "relating" the entry to other entries.
The ElementCriteriaModel parameter to filter by related entries is the relatedTo parameter.
Something like this should do the trick:
{% set params = {
    section: 'events',
    order: 'eventShowtime desc',
    relatedTo: venueId
} %}


---

