Your code was perfect! I just changed it to meet my specific site. It actually taught me what I needed which is better than a cut and paste. I am new to Wix (but not coding) and just needed an example. Thanks again for your help.
@jeff-haskins You can add a dataset to the page, connect it to the collection that has your image, then connect the image to the image field in the dataset. You can also set a filter in the dataset to get the image you want.
You could also do a wix-data.query() based on whatever filter conditions you want to get an image. You can randomize the query, or base it on user’s location, the weather, or your current state of mind.
Hi, I’ve the image in wix dashpboard, link copied, repeater setup, dataset linked with image but still only getting the results where the images are stored. Other fields are empty.
While filtering there are only two options empty or not empty. I can’t understand how to add default avtar where no image is fetched.
I too would like to update a default image to the gallery field (field type Media Gallery)! Better yet, let us access the Media Gallery via a Media Gallery field type on a repeater or page! I’ve voted for this feature but I’m not sure it goes far enough (when it is implemented). #multipleMediaFiles#uploadFiles
I’ve just been trying to do this using a default image in a collection. The idea was that there would be an input form which would upload monthly newsletters to the collection for display. The form had text fields for year, month, and title and a document field for the newsletter itself. Then I wanted to add a picture to display with each entry but I wanted a default image in case the newsletter editor forgot or chose not to add a picture this month. That was easy enough to set up until I read the fine print which said a default image will only apply when directly updating the CMS, not when adding records via input elements. I admitted defeat at that point.