Shopify themes, liquid, logos, and UX
Hopefully this will be a simple question. I am porting from the script tag API to theme app extension embedded block. The current implementation has 2 parameters being registered with script tag API by passing these as parameters
i.e. adding ?param1=foo¶m2=bar
On the client side these parameters are retrieved by looping over the java scripts and parsing the parameters.
I'd like to port my app as low friction as possible and have tried to implement the same in a liquid block:
Solved! Go to the solution
This is an accepted solution.
This is how I solved it for anyone interested.
Liquid
{% assign param1 = 'true' %}
{% assign param2 = '6Le26rQfAAAAAIkjnI6O3QFzT0DOTUUm2nzAJfPy' %}
<script id="myscript" src="{{ 'myscript-dev.js' | asset_url }}" data-param1={{ param1 }} data-param2={{param2}} defer></script>
Client Javascript
This is an accepted solution.
This is how I solved it for anyone interested.
Liquid
{% assign param1 = 'true' %}
{% assign param2 = '6Le26rQfAAAAAIkjnI6O3QFzT0DOTUUm2nzAJfPy' %}
<script id="myscript" src="{{ 'myscript-dev.js' | asset_url }}" data-param1={{ param1 }} data-param2={{param2}} defer></script>
Client Javascript
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