<p>I'm trying to get a list of entries that have at least one asset in it (standard assets field) called "assets".</p>

<pre><code>{% for entry in craft.entries.section('banks').first.assets.filename(':notempty:').limit(2) %}
&lt;p&gt; {{ entry.title }} 
{% endfor %}
</code></pre>

<p>It don't show anything, no errors either.</p>

<p>Please advice.</p>

CC BY-SA 3.0
2015-01-29T15:49:23.943Z
Mark, I already asked this question here: ["How can I get only those entries with non-empty assets field"](http://craftcms.stackexchange.com/q/129/125). Hope this helps!
carlcs
CC BY-SA 3.0
2015-01-29T17:03:31.297Z
Thanks but none of the snippets work for me. Is my piece in the initial question wrong?
Mark H.
CC BY-SA 3.0
2015-01-29T17:15:07.973Z
Yes, it's wrong. You do it with the `relatedTo` parameter, see the answer I accepted.
carlcs
<assets><custom-field><order>
Display only those entries that have assets
# Display only those entries that have assets

(Asked by: username_0 on 2015-01-29)

I'm trying to get a list of entries that have at least one asset in it (standard assets field) called "assets".
{% for entry in craft.entries.section('banks').first.assets.filename(':notempty:').limit(2) %}
 {{ entry.title }} 
{% endfor %}

It don't show anything, no errors either.
Please advice.

**Tags:** assets, custom-field, order

> **Comments:**
> **username_1**: Mark, I already asked this question here: ["How can I get only those entries with non-empty assets field"](http://craftcms.stackexchange.com/q/129/125). Hope this helps!  
> **username_0**: Thanks but none of the snippets work for me. Is my piece in the initial question wrong?  
> **username_1**: Yes, it's wrong. You do it with the `relatedTo` parameter, see the answer I accepted.  

---

## 0 answers

