In the case that I have an asset folder structure like this:


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

1 Answer 1


You could use the folderId-parameter in craft.assets:

{% for image in craft.assets.folderId(1) %}
    <li><img src="{{ image.getUrl('thumb') }}" alt="{{ image.title }}"></li>
{% endfor %}

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

  • 1
    Is there also a possibility to this recursively? Getting all files from the subfolder and its subfolders.
    – Lars Bilke
    Commented May 20, 2016 at 19:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.