I am trying to pass this information to a custom module:
{% set parent_items = [
{
"parent_item_link": {
"url": {
"href": "https://example.com"
},
"open_in_new_tab": true,
"rel": null
},
"parent_item_label": "Example 1"
},
{
"parent_item_link": {
"url": {
"href": "https://example.net"
},
"open_in_new_tab": false,
"rel": null
},
"parent_item_label": "Example 2"
},
{
"parent_item_link": {
"url": {
"href": "https://example.org"
},
"open_in_new_tab": true,
"rel": null
},
"parent_item_label": "Example 3"
}
] %}
{% module "hero_banner"
path='../modules/breadcrumb-hero',
label='Breadcrumb Hero',
parent_items=parent_items,
current_item_label='Current Page',
offset=0
%}
This doesn’t work, but if I provide the value directly without setting it to a variable first, it works perfectly:
{% module "hero_banner"
path='../modules/breadcrumb-hero',
label='Breadcrumb Hero',
parent_items=[
{
"parent_item_link": {
"url": {
"href": "https://example.com"
},
"open_in_new_tab": true,
"rel": null
},
"parent_item_label": "Example 1"
},
{
"parent_item_link": {
"url": {
"href": "https://example.net"
},
"open_in_new_tab": false,
"rel": null
},
"parent_item_label": "Example 2"
},
{
"parent_item_link": {
"url": {
"href": "https://example.org"
},
"open_in_new_tab": true,
"rel": null
},
"parent_item_label": "Example 3"
}
],
current_item_label='Current Page',
offset=0
%}
How can I pass the value as a variable instead?