Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

Re: custom variable use in theme APP extension block

custom variable use in theme APP extension block

kurveej
Shopify Partner
11 0 1

Hello,

 

can someone help me with this?

 

is there any way to create variables with value into theme.liquid file and use that variable in the APP theme extension block file?

 

image (21).jpg

 

Thanks,

Kurvi

Kurvi Kansagra
Replies 2 (2)

OlivierB
Shopify Partner
9 0 1

Hi! Normally you use the id of your block as a variable. If I declare a block :

{
"type": "number",
"id": "number_price",
"label": "Price",
"default": 100,
}
After I can use the value of my block with 
{{ block.settings.number_price }}
If you really need a variable :
{% liquid
assign variable = value
%}
and to use the variable : {{ variable }}
kurveej
Shopify Partner
11 0 1

Thank you for you answer, but I am not looking for this. I want to create variable into template theme.liquid and use that variable in the APP theme extension block file.

 

Thanks,

Kurvi

Kurvi Kansagra