<p>It may not be suitable for your use case but you could use an <a href="https://docs.craftcms.com/v3/dev/element-queries/asset-queries.html" rel="nofollow noreferrer">Asset query</a> to fetch assets related to your entry:</p>

<pre class="lang-twig prettyprint-override"><code>{% set assets = craft
    .assets()
    .withTransforms(['eventImage'])
    .relatedTo({
        sourceElement: entry,
        field: ['your','fields']
    })
    .all() %}

{% for asset in assets %}
...
{% endfor %}
</code></pre>

<p>(If these are your only asset fields on the entry, you don't need <code>field: ['your','fields']</code>)</p>

CC BY-SA 4.0
2020-03-05T18:58:41.630Z
2020-03-06T09:27:44.633Z
2020-03-06T09:27:44.633Z
Oli
<p>I'm looking to see if there's a better way of querying multiple asset fields in one query, surely there is but I just can't seem to find it in the docs. </p>

<pre><code>      {% for asset in entry.eventMediaTile.all() %}
        &lt;a class="carousel-item white-text" href="#{{ loop.index  }}"&gt;
          &lt;img alt="{{ entry.title }} Images" src="{{ asset.getUrl('eventImage') }}"/&gt;
        &lt;/a&gt;
      {% endfor %}
      {% for asset in entry.eventMediaTriplet1.all() %}
        &lt;a class="carousel-item white-text" href="#{{ loop.index  }}"&gt;
          &lt;img alt="{{ entry.title }} Images" src="{{ asset.getUrl('eventImage') }}"/&gt;
        &lt;/a&gt;
      {% endfor %}
      {% for asset in entry.eventMediaTriplet2.all() %}
        &lt;a class="carousel-item white-text" href="#{{ loop.index  }}"&gt;
          &lt;img alt="{{ entry.title }} Images" src="{{ asset.getUrl('eventImage') }}"/&gt;
        &lt;/a&gt;
      {% endfor %}
      {% for asset in entry.eventMediaTriplet3.all() %}
        &lt;a class="carousel-item white-text" href="#{{ loop.index  }}"&gt;
          &lt;img alt="{{ entry.title }} Images" src="{{ asset.getUrl('eventImage') }}"/&gt;
        &lt;/a&gt;
      {% endfor %}
      {% for asset in entry.eventMediaTriplet4.all() %}
        &lt;a class="carousel-item white-text" href="#{{ loop.index  }}"&gt;
          &lt;img alt="{{ entry.title }} Images" src="{{ asset.getUrl('eventImage') }}"/&gt;
        &lt;/a&gt;
      {% endfor %}
      {% for asset in entry.eventMediaTriplet5.all() %}
        &lt;a class="carousel-item white-text" href="#{{ loop.index  }}"&gt;
          &lt;img alt="{{ entry.title }} Images" src="{{ asset.getUrl('eventImage') }}"/&gt;
        &lt;/a&gt;
      {% endfor %}
</code></pre>

<templating>
Multiple Asset Field Query
# Multiple Asset Field Query

(Asked by: username_0 on 2020-03-05)

I'm looking to see if there's a better way of querying multiple asset fields in one query, surely there is but I just can't seem to find it in the docs. 
      {% for asset in entry.eventMediaTile.all() %}
        
          
        
      {% endfor %}
      {% for asset in entry.eventMediaTriplet1.all() %}
        
          
        
      {% endfor %}
      {% for asset in entry.eventMediaTriplet2.all() %}
        
          
        
      {% endfor %}
      {% for asset in entry.eventMediaTriplet3.all() %}
        
          
        
      {% endfor %}
      {% for asset in entry.eventMediaTriplet4.all() %}
        
          
        
      {% endfor %}
      {% for asset in entry.eventMediaTriplet5.all() %}
        
          
        
      {% endfor %}

**Tags:** templating


---

## 1 answers

### Answer by username_1 on 2020-03-05. Score: 2 | Accepted answer

It may not be suitable for your use case but you could use an Asset query to fetch assets related to your entry:
{% set assets = craft
    .assets()
    .withTransforms(['eventImage'])
    .relatedTo({
        sourceElement: entry,
        field: ['your','fields']
    })
    .all() %}

{% for asset in assets %}
...
{% endfor %}

(If these are your only asset fields on the entry, you don't need field: ['your','fields'])


---

