<h3>Twig</h3>

<pre class="lang-twig prettyprint-override"><code>{% set assets = craft.assets.volumeId(y).folderId(x).all() %}
</code></pre>

<h3>PHP</h3>

<pre class="lang-PHP prettyprint-override"><code>$assets = Asset::find()-&gt;volumeId(y)-&gt;folderId(x)-&gt;all();
</code></pre>

CC BY-SA 4.0
2018-08-31T14:55:10.710Z
Live can be so simple! Up and running, thanks
Robbie Post
CC BY-SA 4.0
2018-08-31T13:29:45.890Z
2018-08-31T13:29:45.890Z
Robin Schambach
<p>Is there a way to pull all assets from a volume subfolder id?</p>

<pre><code>{% set entries = craft.entries.section('pages').type('genealogy').search('pageType:stake') %}
{% for entry in entries.all() %}
    {% if entry.id == x %}
        get all assets from volume subfolder a
    {% elseif entry.id == y %}
        get all assets from volume subfolder b
    {% endif %}
{% endfor %}
</code></pre>

<assets><craft3>
Pull all assets from a specific volume subfolder id
# Pull all assets from a specific volume subfolder id

(Asked by: username_0 on 2018-08-31)

Is there a way to pull all assets from a volume subfolder id?
{% set entries = craft.entries.section('pages').type('genealogy').search('pageType:stake') %}
{% for entry in entries.all() %}
    {% if entry.id == x %}
        get all assets from volume subfolder a
    {% elseif entry.id == y %}
        get all assets from volume subfolder b
    {% endif %}
{% endfor %}

**Tags:** assets, craft3

---

## 1 answers

### Answer by username_1 on 2018-08-31. Score: 2 | Accepted answer

Twig
{% set assets = craft.assets.volumeId(y).folderId(x).all() %}

PHP
$assets = Asset::find()->volumeId(y)->folderId(x)->all();

> **Comments:**
> **username_0**: Live can be so simple! Up and running, thanks  

---

