Jump to content

Add images to the start of field


Mikie
 Share

Recommended Posts

Hey, I've tried a search but couldn't find anything about this precisely.

Is there any explicit setting to add images to the start of an image field rather than the end on upload?

I'm assuming I'll need to figure this out with hooks.

Please ignore. Noob mistake asking a question from a client, they weren't drag dropping and I had a brain spasm.

  • Like 1
Link to comment
Share on other sites

All good. Did you know about:

$page->images->first

and

$page->images->last

I often use $pages->images->last when client uploads images and wants the last one to display. To get really specific, you can call the image within a Pageimages array by calling the image by its index. Pageimages derives from WireArray which allows you to call an item by its index https://processwire.com/api/ref/wire-array/eq/

 

 

 

  • Like 1
Link to comment
Share on other sites

Thanks @psy yeah I know about those, it was more an editing workflow thing. Client has 50 + images in a gallery, flagged they were being added to the end not the start. I didnt realise they were using the filesystem select and not just drag dropping onto the field. Having said this, it's interesting that those two workflows for adding images function differently.

  • Like 1
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...