RESOLVEDRevisiting a theme: unique slideshow on dynamic page

Hi Everyone…hoping for some help. I posted this first here: https://www.wix.com/code/home/forum/questions-answers/database-and-dynamic-product-page, but I am unsure how to know if it will be seen there, so forgive the duplication…

I am trying to achieve a similar result and having some difficulty.

my site: salutetovienna.com
my sample page: salutetovienna.com/2019/boston & salutetovienna.com/2019/calgary (gallery in question is below “Thank You” at the bottom of the page)

I have 25 cities, each with a different number of sponsor images. I was hoping to have them cycle near the bottom of the page. Both of the options above make sense to me but having tried the first and not getting it to work, I think I need some help:

Here is my page code (all of it, in case that helps):
// For full API documentation, including code examples, visit http://wix.to/94BuAAs
$w.onReady(function () {
//TODO: write your page related code here…
});$w.onReady(() => {
$w(‘#2019 dataset’).onReady(() => {
let item = $w(‘#2019 dataset’).getCurrentItem();
$w(‘#gallery3’).items = [
{src: item.spon1},
{src: item.spon2},
{src: item.spon3},
{src: item.spon4},
{src: item.spon5},
{src: item.spon6},
{src: item.spon7}
];
});
});

The assistant code builder suggested I add semicolons after the last two lines of text.
It also did not like any other version than lowercase “gallery3” and database name “2019 dataset” (also lowercase)… I do notice when I connect the database to other items that it is referred to as “2019 Item”; perhaps that is an issue (it was not accepted as a dataset name)?
At the moment, I only have 7 image placeholders within the dataset but only boston and calgary rows have any images placed within them.

I connected “gallery3” to the dataset 2019 but not to spon1 image and then disconnected it… I am not sure if the gallery is supposed to be actively connected to the dataset for this to work. Neither option seemed to make a difference.

I have synced my dataset to live, and published the site, but nothing seems to be populating the gallery.

Any help would be greatly appreciated. Please note that I have blank/white placeholder jpgs on the gallery/carousel & the Boston page is currently in use.
Stephanie

1 Like

Yoav, Thanks for the code this worked for me using your first suggestion- .
Stephanie, so using the code example above that Yoav posted, the first step is to click on the dataset icon sitting on your dynamic page >properties panel> and click on “onReady” and that initiates the code. Then copy the code from Yoav’s example replacing the specific dataset name, gallery name and image value’s from the database. You are very close- I think just that first step with the dataset. I also added the semi colons :wink: Hope that helps.

Thank you very much Lorraine.
Unfortunately, I am missing something… I did exactly what you said and still my logos will not show:


This is my right click on the dataset “2019 Item” and click onReady.
The code was initiated as you said, I had deleted everything prior and pasted in only Yoav’s code which I updated with “2019 Dataset” and “gallery 3” and my own images:


I published and previewed and still no images.

There are several warning items that have appeared:


After I received this ESLint warning above, I replaced the code that I had deleted starting: // For full API documentation… and ending: }); and then the same warning appeared on the first line again.


When I preview the site and look at the Developer Console, I get these lines of text:


Here is what the gallery looks like: (it is connected to the dataset and does not work when it is disconnected from the gallery)


Gallery set up:

And this is what the Calgary page (https://www.salutetovienna.com/2019/calgary) looks like when I highlight the gallery - it is running just with the blank images I entered above


Thank you so much for your help.
Stephanie

Hello my friend …
First in javascript, id any element can not contain spaces…
Second, in wix have special Sliders and you can add the images you want without Database just change defualt images …

Thabet Maali,

Thank you very much. I am not sure why my dataset is not recognised but I can go without in this instance.

BEst,
Stephanie

Hey,

I’ve got the dynamic pages displaying a slideshow from a dataset using the code above.

I have one request for help: My dataset has a total number of columns for images @ 10 per row. Some rows will have all 10 populated but some may not. When I view my slideshow for those without 10 in the row, they still have “1/10” but the remaining blank columns from the dataset show a blank image. Is there any way around this? Can I do a null check on the specific field in the dataset?