1

I am an expressionengine novice, so apologies if my question reflects that. I'm looking for a way to display images in a specified order (i.e. not by date, size, etc.), such as by ID. I've searched high and low but can't find this functionality. Is it possible??

UPDATE: user "Cheyney" helped to tease out my actual question, which was not specifying order of images within an entry (which can be done with the Move icon in the Actions column, as Cheyney describes), but rather specifying order of entries to display images on the homepage. The solution was to order the entries using "orderby" within the Channel Entries tag, as opposed to ordering images within the Channel Images tag. Thanks to Cheyney for "sorting" this out for me!

1 Answer 1

1

You can use the "orderby" parameter.

{exp:channel_images:images entry_id='{entry_id}' orderby='image:id' sort='asc'}

See: http://www.devdemon.com/documentation/tag/images/

Channel Images orderby Documentation

UPDATE 1: If you want images in a specific order then you need to move them inside the entry into the order you want using the Move icon in the Actions column.

NOTE: The cover image with always come first if your field is set that way.

Channel Images Field Screenshot

UPDATE 2: Based on further OP comments below here is the code to sort ENTRIES by order and then display the single COVER IMAGE for that entry.

{exp:channel:entries channel='XYZ' dynamic='yes' orderby='9|1|4|2' category='###'}
    {exp:channel_images:images entry_id='{entry_id}' cover_only='yes'}
        <img src='{image:url}' />
    {/exp:channel_images:images}
{/exp:channel:entries}
6
  • Thanks so much for the response. I had seen "orderby" in the documentation, but noticed the parameter options are missing. With orderby='image:id', is it possible to specify the order by which images are displayed? I want to display images in a specific order (i.e. not ascending or descending), but by IDs such as "695|281|218|401|600". Is that doable? thanks again
    – jcbtfc
    Feb 16, 2015 at 16:28
  • I think I am looking for something like the fixed_order parameter of the channel entries tag....
    – jcbtfc
    Feb 16, 2015 at 19:12
  • Images ARE in the order by which they will be displayed in the Channel Images field. All you need to do it place them in the order in which you want within the field. Use the blue icon (with the up and down arrows in it) in the Actions area to move the images into the order you want them displayed. Edited my answer to include this info
    – Cheyney
    Feb 17, 2015 at 3:49
  • Very helpful. But what if I'm pulling images from different entries onto another page. In my situation, I have a category "feature on homepage" which I set to flag images to be used in a rotating slideshow on the homepage, where I have the following code: {exp:channel_images:images entry_id="{entry_id}" category="feature on homepage" sort="asc"} So my trouble is trying to get these homepage images in a specific order. That's why I was thinking it would be nice if I could specify order by image ID, such as 695|281|218|401|600. Any idea? Thanks much
    – jcbtfc
    Feb 17, 2015 at 17:28
  • So your logic currently is "For Entries chosen to display images in the Featured code on the homepage show XXX number of images from the Channel Images tag". in which case your issue isn't sorting the Image ID's into a particular order. Your issue is getting the ENTIRES in certain order since the channel Images tag is inside the Channel Entries tag. If that is the case you need to edit the Channel Entries tag and not the Channel Images tag. PS: You really should update your question... please.
    – Cheyney
    Feb 18, 2015 at 2:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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