D
D
Devero972020-12-23 14:43:32
MongoDB
Devero97, 2020-12-23 14:43:32

How to upload images and then display them in a dynamic page?

I have an admin panel where I create a post. There I fill in the data (many items), then I get the data on the frontend and fill the dynamic page with it.
I have created an image upload component to get their titles and display them through an array in a dynamic page. Everything works, but not as it should.
The whole point is that I should have not one array of images, but several arrays, with the names of the images, their alts and additional ones. parameters (text above pictures, etc.). You can solve this problem by creating a collection in the database and adding titles and extras there. image properties when loading. And then get these pictures from the collection in the database with additional. properties, where, by means of single and multiple selection (select), add both image names and additional ones to different arrays. parameters that belong to them. And then display these arrays in a dynamic page and loop through them. It seems to be decided, but...
I don't need a list of the entire collection of images from the database, there may be hundreds of them, and then it will not be possible to select the ones you need.
Therefore, it is necessary to somehow receive only downloaded pictures with additional. properties from the collection when creating a post. It seems to me that I should create a dynamic collection in the collection of pictures the first time the picture is loaded, which will contain the newly added pictures. But how then to get data from this collection, if it is not there initially.
Tell me at the level of the idea (without code), how can I implement this functionality? Am I thinking in the right direction? Or should I have a different way of doing things?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question