Join the Webstudio community

S
Suzan
Offline, last seen 4 weeks ago
Joined December 13, 2024
Hi, I‘m new to Webstudio and I hope I‘m asking this in the right place :)

I’m using Google Sheets as a CMS with linked images from Google Drive and with the table turned into a JSON via Google Apps Script. So this is about loading data dynamically.

It works well to bind components to single data points (like things.data[2].image) as well as loading all the data dynamically into a Collection, it all displays correctly.

Now my issue is that in some places of my website I only want some parts of my data, for example [0] to [50] are of the category „great fruit“ while [51] to [100] is „great cakes“ (the namings are just examples).

I tried things like „things.data[0-50]“ and „things.data.slice(0,51);“ but I start feeling that maybe this isn’t possible?

Can I only load part of my JSON into a Collection? By for example filtering it somehow or specifying with an if-clause, because I do have categories in my table by which I could filter but I don’t really know where to put any of that or how.

I‘m trying to make galleries that follow certain categories with that. I could create different tables per category, but I‘d rather find a better solution in case there is one.

Thanks for any tip!
4 comments
S
S
B