3

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.

4

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
  • 1
    Is there also a possibility to this recursively? Getting all files from the subfolder and its subfolders. – Lars Bilke May 20 '16 at 19:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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