Is it possible to write JSON code inside of a liquid template file?
I first made a json template file, and created a simple collection carousel in the editor. Then I made a liquid template file. From there I would like to copy paste the json data that creates the collection carousel into the liquid file, so that I can create logic for how and when this collection carousel should be rendered.
Let’s say that I for instance would like to have this inside of a liquid template file:
{
"sections": {
"main": {
"type": "main-product",
"settings": {
"gallery_size": "6",
"sidebar": "off",
"enable_sticky_sidebar": false,
"show_tabs": false,
"show_tab_description": false,
"show_tab_reviews": false,
"scrolling_to_opened_tab": false,
"tabs_type": "tabs"
}
},
"related-products": {
"type": "carousel-related-products",
"settings": {
"show_section": true,
"title": "MER FRA DENNE SAMLINGEN",
"type": "related",
"size_of_columns": "4",
"max_count": 10,
"autoplay": true,
"speed": 5,
"infinite": true,
"arrows": true,
"bullets": true
}
},
"carousel_products_yAkTqb": {
"type": "carousel-products",
"blocks": {
"collection_iamnQF": {
"type": "collection",
"settings": {
"title": "",
"collection": "annet-tilbehor"
}
}
},
"block_order": [
"collection_iamnQF"
],
"settings": {
"show_title": true,
"container": "boxed",
"size_of_columns": "4",
"max_count": 6,
"autoplay": true,
"speed": 5,
"infinite": true,
"arrows": true,
"bullets": true
}
}
},
"order": [
"main",
"related-products",
"carousel_products_yAkTqb"
]
}
Is this possible?