We're moving the community! Starting July 7, the current community will be read-only for approx. 2 weeks. You can browse content, but posting will be temporarily unavailable. Learn more

Use a custom array with translations objects

Use a custom array with translations objects

Stefan_W
Shopify Partner
37 0 1

I am looking for a more elegant solution to add a translation in the code then a case of if solution.

So this is what I made now, but I can't seem to get it to display the result:

 

{% assign test_array= '{ "name": "test name", "object": "test object"}' | json_parse %}
{{ test_array[name] }}

When I just add {{ test_array}} I do get the content in the front-end

 

{ "name": "test name", "object": "test object"} 

 

 

Does someone know what part is wrong here?

 

Replies 0 (0)