I need to display an array of pictures in order but i am not aware of how to accomplish this. this is an EE 2.4 system.

  • We'll need much more information before anyone can help you. How are your images stored? What have you tried so far? May 19 '16 at 12:55

You've tagged your question with Assets, so have you tried the orderby parameter in the output?

"Order the files by a property or metadata value. Pair with the sort parameter to control the sort order."

This Stack Exchange answer might also help.

Otherwise assuming you want a solution to implement, rather than an existing setup this is what I'd recommend...

Image ordering

Problem is you're using EE v2.4 and the native grid wasn't introduced until v2.7. I'd highly recommend upgrading due to the security updates and bugs, let alone the additional features that have been introduced. But let's assume you can't upgrade, you can use Matrix which works from EE v2.4 to replicate the same ability.

Using Grid/Matrix, your editor/admin has control of the order of images by dragging and dropping the rows.

    {if url-link}<a href="{url-link}" title="{image-title}">{/if}
    {if video}<a href="{video}" class="fancybox-video" title="{image-title}">{/if}
        <img src="{image}" alt="{alt-text}">
    {if "{url-link}" || "{video}"}</a>{/if}

Example above obviously adds more column features that you probably won't need. You might also want to utilise sized images (either natively with Upload Preferences or via CE Image).

If you want to change the order based on template or allowing re-ordering from user input (e.g. a gallery), then both Grid and Matrix allow for orderby parameter.

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.