Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
Hi, I have a question.
Is it possible to assign values to the theme options declared at settings_schema.json without using the theme customizer?
Or should I stick to the theme switching feature available with the Launchpad app?
The main issue if the latter is the only possibility is that I have 12 different scenarios to apply based on a specific set of dates, meaning that 12 different themes should be enabled to be successfully managed through Launchpad.
And that implies a problem because if the slightest change should be made, let's say, changing the font on one specific span, or the color on one specific div, or the background on one specific p, this change should be made across all the 12 different themes, OR I'd have to rely on a tool like jQuery to make the change dynamically (meaning that the overall loading time of the DOM would be increased anyways).
All this was provoked because I can no longer nest snippets with render (unlike with include) and I'm switching to a new theme that is fully backed up by Shopify, although they don't directly give support to it (Warehouse, Maestrooo).
Solved! Go to the solution
This is an accepted solution.
I would look for a way to swap out your changes using javascript. This may mean setting up theme settings for each of your 12 scenarios. For example, output all the theme settings (liquid) into a JSON array, and then use javascript to use the right set of settings.
This is an accepted solution.
I would look for a way to swap out your changes using javascript. This may mean setting up theme settings for each of your 12 scenarios. For example, output all the theme settings (liquid) into a JSON array, and then use javascript to use the right set of settings.
Thank you very much Gina, for taking a bit of time to read this.
I've already seen this answer before, to be specific, here. I was expecting that things could have changed a bit from Feb 2020 to Jan 2021, but it seems that that's not the case.
I will declare all the values I need and then invoke the values I need through JS, just as you've said.
Wish me luck, good day.
Starting a B2B store is a big undertaking that requires careful planning and execution. W...
By JasonH Sep 23, 2024By investing 30 minutes of your time, you can unlock the potential for increased sales,...
By Jacqui Sep 11, 2024We appreciate the diverse ways you participate in and engage with the Shopify Communi...
By JasonH Sep 9, 2024