Answer the question
In order to leave comments, you need to log in
How to upload photos to the Bitrix infoblock, with the ability to change the order of displaying photos?
Good afternoon!
There was a need to make it possible to upload images to the site through its upload form. Everything seems easy, but you need the ability to change the order of displaying photos on the site. For example, the client uploads 5 photos, then moves them as he wants (using jquery sortable()), then clicks the save button. And it is required to display photos in the order specified by the client.
Can you tell me how to implement this?
Or is it possible to use the standard Bitrix loader prntscr.com/ffqpfu for this?
Answer the question
In order to leave comments, you need to log in
Each file in Bitrix has a description field
joxi.ru/YmE0Gg8HZbWp8r
You can store the sort index in this field
Display a hidden field for each image in the form. There you will write the sort value.
In the public part, it’s easier to screw up your own solution than to fence Bitrix’s, and I’m not sure that this is even possible.
The multiple property type file is sorted by itself. Those. if you upload photos in the admin panel and after that change the sorting by simple drag and drop, then it also changes in the public part. Proceeding from it it is necessary for you to save in property ID of files in the necessary order.
As Maxim answered
Display a hidden field for each image in the form. There you will write the sort value.you send the form to the server and already process the data so that you get an array with the file IDs in the right order. And you save, and for this you need to use one of the methods for saving properties:
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question