How to create image gallery?

I would like to create an image gallery for an individual’s portfolio in my database.

How would I go about doing this?
How would my database need to be structured?

You would just add as many images to the User collection that you want them to have.

Or if it’s an unknown amount - you can start a new database called “gallery” or something like that and have users create a new image in it every time and link that to the user.

Hi @Dejon313,

Let me elaborate on @Bobby 's answer a bit.

What I would suggest:

  • Create a collection, call it, for example, “Portfolio_Images”;
  • Add an “Image” property to this database;
  • Assuming that individuals you’re talking about are in Users collection, create a relation between Users and Portfolio_Images: One user can have Many Portfolio_Images, but each Portfolio_Image belongs only to one user.

When you create a new image in “Portfolio_Images”: don’t forget to link it to Logged-in User (if you’re allowing a user to add photos to his/her portfolio)

To display all images for some user’s portfolio - have a list and filter it using this relationship.

Best regards, Victor.

1 Like

In my situation, the image gallery doesn’t belong to users.
It is more like an item with many images creating the gallery.

Then you can apply the same logic to Items collection.

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.