Upload multiple images and select one of them as the main

Hi guys,

Let’s assume I want to build a market for second hand cars.

I want the users to upload multiple images of the cars which can be easly done with multi file uploader.

I would like to show one of these uploaded images as the main image which be displayed on the search results or when someone visits the ad.

I have an ugly solution where user uploads a single file as the main photo and uploads multiple photos for the others.

Can you suggest a better solution? :slight_smile:

1 Like

@kaanaksoy81 I have an idea. Once the user uploads the photos, you can show them in a repeating group. And allow the user to click on one to set it as the “cover photo” which would be a separate data field. You can accomplish this using custom states in a repeating group. The repeating group can be shown only when the user uploads files. The repeating group data source would be the multi-file uploader value.

1 Like

Thank you Joseph.
Are you suggesting that
car photos which a list of photos data field
car cover photos which is a single photo which is one of the car photos (list of photos)

If yes,
Does it mean that I create (dublicate) an existing photo in list of photos and have it saved in the cover photos
OR
Reference the single of photo in the list of photos to cover photo field.

I was originally suggesting to create a duplicate of the photo the user chooses to become the cover. I havent tried your 2nd option but it would be ideal to minimize the size of each entry for the long run. If you can get it to reference that specific image in the other field, that is ideal. I just never tried that.

But yes that is my overall concept. Similar to how facebook marketplace does it. It shows you all the images uploaded and you can press on the one you want as #1.

Thank you again! :star_struck:

1 Like

There’s also a very nice component from Airdev Canvas for that. You select as many images as you want, and you simply click on the one you want to be the master one. It works really great. @AirDev

2 Likes

Thank you @Christophe_HK . I will check it now.

1 Like

This topic was automatically closed after 70 days. New replies are no longer allowed.