Newbie Question : Where to put Array Definition Code ?


Hi There, 

I am just starting my FIRST theme improvement project with a very simple code.


I will need to define an array and got instructions for that ... BUT 

considering that in the future I want to make this improvement as a Theme Setting Definition  I was wondering 

Where to put the piece of Code defining array ? 


Should I create a New Template File ?  A new section file ?  A new Sniped ?

What I now is that the logic handling the Array will be into product.liquid as the customization is for Product Page.


Thanks in advance , William 

William Alencar
GoodFy Brasil
Shopify Partner
78 3 7

This is an accepted solution.

What are you referring to when you say: "Theme Setting Definition"?

Sorry, I probably just need to get some sleep.

Anyway, if you're asking what I think you're asking, you could probably just go drop your array inside a script tag in - as you referenced: /templates/product.liquid -or- you could also drop it in the top of /sections/product-template.liquid ... just don't stick it anywhere that could be affected by any conditional statements ... unless that's the effect your looking for.

But ya - no need to go creating new files; just drop it in one of those two files.


Something like:

<script type='text/javascript'>
var myArray = ['whatever', "you're", 'array', 'looks', 'like'];
Most people, it turns out, just aren't interested unless they have to pay for it. Go figure.
1 Like

Hi there PhobosTech, 


thanks a lot for your message. Yes you could got what I was asking .


I will do the way you have suggested.


Thanks a lot and take some rest .


Best REgards 

William Alencar
GoodFy Brasil
1 Like