Image ordering #4405
Replies: 6 comments 2 replies
-
This feature would really improve the UX |
Beta Was this translation helpful? Give feedback.
-
I am facing the same issue, it will be good to have this feature. |
Beta Was this translation helpful? Give feedback.
-
Is this still not possible? |
Beta Was this translation helpful? Give feedback.
-
I discovered that the architecture behind image storing in medusajs (at least v1, I haven't yet try v2) is flawed, even when images are given in the correct order to the product service they are saved without creation date or order, so when retrieving from db, I think they are ordered by id... |
Beta Was this translation helpful? Give feedback.
-
I managed to get ordering working by extending the image model. Here is how to setup the backend to handle the new order property. Then all you have to do is create a custom widget in admin to show and reorder images and api route to call the product service with the new reorder function. 1. Extend the image model
2. Modify the Image repository, replacing the functions
3. Create migrations for the new order field:
4. Set order for existing images using migration (Optional):
5. Extend validators:
6. Extend your product service with a new function to reorder images (I have two types of images, you only need one):
|
Beta Was this translation helpful? Give feedback.
-
Hello everyone, thanks for the suggestion! With the release of 2.0.6 it's now possible to re-order images both during product creation and updates. The rank of an image is determined by its position in the |
Beta Was this translation helpful? Give feedback.
-
I would like to reorder the images attached to my products via Admin UI without deleting them and reattaching in correct order.
Beta Was this translation helpful? Give feedback.
All reactions