I'm sure this is an easy one to answer.

I have a matrix field which I am using together with CE Image to create a gallery. It contains two columns and a variable number of rows depending on how many images it contains.

Like so:


{gallery limit="1"}

    {exp:ce_img:pair src="{image_url}" crop="yes|smart_scale" width="420" height="315" allow_scale_larger="yes" filter="sharpen" limit="1" quality='60' add_dims="no"}

    <img src="{made}" alt="{title}"/>



But I want the image to be the one that is "1" in the Image Order Number (image_order) column.

  • You know that Matrix rows are drag and drop to reorder, right? So unless you need a secondary sort order you could just reorder the rows in the Publish form and rely on the actual order of the Matrix field instead of creating an "order" column.
    – Alex Kendrick
    Apr 25, 2013 at 14:19
  • yep, that would fine, had it not been for the fact that there are over 2000 entries! Wouldn't want to do that manually! :)
    – shorn
    Apr 25, 2013 at 18:21
  • I see. Part of your import project. Good call!
    – Alex Kendrick
    Apr 25, 2013 at 19:03

1 Answer 1


Well that was simple! just added the orderby="image_order" parameter to the matrix tag pair.

I had tried that originally, but it was using the already cached images. Once they were deleted out, it regenerated the right ones.


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.