Is there any way to programmatically change the .cardSize property?


I have a current gallery view right now and it's set to half cardsize. I was wondering if there is a way for me to run a JS query to update the cardSize to 'full' and have it trigger from a button?

Screenshot below:

Hey @Cat_Cat! It doesn't look like the card size can be dynamic, but I'll file a feature request for that now.

In the meantime, I think your best bet would be to have a button that runs a script to 1. hide itself and the half cards and 2. show another button and an identical collection with full cards. The second button would do the opposite (1. hide itself and the full cards and 2. show the first button and the half cards)

I attached a screen recording of this behavior, as well as an app export for you to poke around with :slight_smile: You can import this JSON file by clicking Create new (home page) >(Mobile Section) From JSON. Quick docs on exporting/importing apps here.

Screen Recording 2023-04-17 at 12.03.42 mobile-20gallery-20view.json

1 Like

Hey Victoria,

Sorry about the delayed response. This is an awesome solution and I will attempt it. +100 for the screen recording <3

Out of curiosity, do both containers xfer data/load in bg even when one is hidden? Or does it xfer data on un-hide? Thank you.

1 Like

No apologies needed whatsoever! Also, thanks to your feedback here, you'll be able to programmatically set the card size in collection views by our next deploy (likely next week) :tada:

And hmm, that's a great question...I assume everything gets loaded, though you can definitely set queries to run only when you land on a certain tab and then enable query caching to make sure you're not manually running the queries every time you switch to the corresponding tabs.

Let me know if I can help with any of this!