Best way to add a large number of IMG with unique titles

Best way to add a large number of IMG with unique titles
0

#1

Hi Campers,

I am making a website to display and sell my mom’s artwork. She has a great many paintings (100 or so?) and I want to display them like I am displaying on the “Artworks” page of the site (linked below). The thing is, each painting will have a unique title, size and price. I thought I would be clever and do some kind of loop with document.createElement, but I was only able to get that working with the images themselves, not a complex element with children and unique titles (I just named the images by number and made a for loop target their number). Is there a good way to make this more automatic, or will I have to manually write the HTML for each img/size/price?

https://snowdenwintermute.github.io/ellen-silverman/artworks.html


#2

You probably want a collection of objects where each object represents a painting and includes all the data that is associated with that particular painting.


#3

Thank you. This makes sense. I will try to find some videos about how to take the info from the objects and put them into the createElement.