<p>I've just realised I can do this: </p>

<pre><code>{% set params = { section : 'stories', order : 'postDate desc', relatedTo: category, limit : '4', storyImage: ':notempty:' } %} 
</code></pre>

<p>Where "storyImage" is the field name of my image field</p>

CC BY-SA 3.0
2017-12-11T11:10:20.167Z
2017-12-11T11:10:20.167Z
codeandchips
<p>How can I find entries with at least 1 image?</p>

<pre><code>{% set category = craft.categories.group('storyCategories').slug(catSlug).first() %}

{% set params = {
  section : 'stories',
  order : 'postDate desc',
  relatedTo: category,
  limit : '4'
} %}
{% set stories = craft.entries(params).find() %}
</code></pre>

<p>I have this, but am not sure how to only get stories entries when the story has an image.</p>

CC BY-SA 3.0
2017-12-06T17:16:51.273Z
Do you put your images in relationfields or do you upload them via redactor? The first is really easy
Robin Schambach
CC BY-SA 3.0
2017-12-06T17:22:11.127Z
The images are in as asset fields.  I've just realised I can do this:
{% set params = {
      section : 'stories',
      order : 'postDate desc',
      relatedTo: category,
      limit : '4',
      storyImage: ':notempty:'  
    } %}

Where "storyImage" is the field name of my image field.
codeandchips
CC BY-SA 3.0
2017-12-06T17:23:25.963Z
Yes indeed. Would you mind adding that as an official answer and mark it as solved for future reference?
Robin Schambach
<entries><image>
Find entries with at least 1 image
# Find entries with at least 1 image

(Asked by: username_0 on 2017-12-06)

How can I find entries with at least 1 image?
{% set category = craft.categories.group('storyCategories').slug(catSlug).first() %}

{% set params = {
  section : 'stories',
  order : 'postDate desc',
  relatedTo: category,
  limit : '4'
} %}
{% set stories = craft.entries(params).find() %}

I have this, but am not sure how to only get stories entries when the story has an image.

**Tags:** entries, image
> **Comments:**
> **username_1**: Do you put your images in relationfields or do you upload them via redactor? The first is really easy  
> **username_0**: The images are in as asset fields.  I've just realised I can do this: {% set params = {       section : 'stories',       order : 'postDate desc',       relatedTo: category,       limit : '4',       storyImage: ':notempty:'       } %}  Where "storyImage" is the field name of my image field.  
> **username_1**: Yes indeed. Would you mind adding that as an official answer and mark it as solved for future reference?  

---

## 1 answers

### Answer by username_0 on 2017-12-11. Score: 1 | Accepted answer

I've just realised I can do this: 
{% set params = { section : 'stories', order : 'postDate desc', relatedTo: category, limit : '4', storyImage: ':notempty:' } %} 

Where "storyImage" is the field name of my image field


---

