Jump to content

Is there any way to sort file/image field content?

Robert Zelník

Recommended Posts

I would like to create a simple image gallery using simple image field with multiple images per page. I would like to show them sorted (newest first). I have tried this:

$images = $page->images->find("sort=-id");
foreach ($images as $image):

It works well with child pages, but it seems like it doesn't work with image fields. Is there any way to sort these images, or should I use repeatable fields instead?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...