<p>You could use the <a href="http://buildwithcraft.com/docs/templating/craft.assets#folderId" rel="nofollow"><code>folderId</code>-parameter</a> in <a href="http://buildwithcraft.com/docs/templating/craft.assets" rel="nofollow"><code>craft.assets</code></a>:</p>

<pre class="lang-twig prettyprint-override"><code>{% for image in craft.assets.folderId(1) %}
    &lt;li&gt;&lt;img src="{{ image.getUrl('thumb') }}" alt="{{ image.title }}"&gt;&lt;/li&gt;
{% endfor %}
</code></pre>

<p>You can get the <code>folderId</code> by inspecting the folder-name in the CP.</p>

CC BY-SA 3.0
2016-05-20T19:06:57.090Z
Is there also a possibility to this recursively? Getting all files from the subfolder and its subfolders.
Lars Bilke
CC BY-SA 3.0
2014-08-18T11:00:01.633Z
2014-08-18T11:00:01.633Z
Victor
<p>In the case that I have an asset folder structure like this:</p>

<pre><code>/images
   /group-a
   /group-b
   /group-c
</code></pre>

<p>How would I loop through all of the images in <code>/group-b</code> without having to assign them to entries.</p>

<assets><forloop><image>
How would I list assets from a specific subfolder?
# How would I list assets from a specific subfolder?

(Asked by: username_0 on 2014-08-18)

In the case that I have an asset folder structure like this:
/images
   /group-a
   /group-b
   /group-c

How would I loop through all of the images in /group-b without having to assign them to entries.

**Tags:** assets, forloop, image


---

## 1 answers

### Answer by username_1 on 2014-08-18. Score: 4 | Accepted answer

You could use the folderId-parameter in craft.assets:
{% for image in craft.assets.folderId(1) %}
    
{% endfor %}

You can get the folderId by inspecting the folder-name in the CP.

> **Comments:**
> **username_2**: Is there also a possibility to this recursively? Getting all files from the subfolder and its subfolders.  

---

