Take the 2-minute tour ×
Craft CMS Stack Exchange is a question and answer site for administrators, end users, developers and designers for Craft CMS. It's 100% free, no registration required.

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.

share|improve this question

1 Answer 1

up vote 4 down vote accepted

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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