grouped_items
This component fetches grouped items of a specific source item, such as a Product that has been Grouped with other Products and allows the ability to navigate between grouped items.
{% component type: "grouped_items", source: "Products", itemId: "<Item ID>" %}
Parameters and Options
grouped_items
This is the name of the entity that needs to be used for the component retrieving function.
<Module name/ID>
<Item ID>
<path/to/layout>
If an empty string, nothing will be rendered.
If paramater is not included, the default virtual layout will be rendered (see below).
item
collection (default)
item
returns each item iteratively, one after another, for output (generally, output to a container element with no need for looping through the data).collection
returns all items as one collection for output (your container element and looping logic would be handled in the Components Layout).<yourLiquidVariableName>
Your collectionVariable value must only contain English letters, numbers or underscores. Spaces or special characters are not supported.
Liquid Output
The below example has 3 related items
and is the default structure you will get from this Component.
{
"Id": 2535,
"Name": "DEMO Product 1",
"Url": "/catalogs/demo-product-1",
"Url_List": [
"/catalogs/demo-product-1"
],
"UrlSlug": "demo-product-1",
"ParentId": 2485,
"ParentId_List": [
-1
],
"ParentName": "",
"ParentUrl": "",
"TemplateName": "",
"Module_Alias": "Product",
"Module_ID": 2485,
"Enabled": true,
"ReleaseDate": "2020-05-04T23:00:00",
"ExpiryDate": "2099-12-11T13:00:00",
"SiteSearchKeywords": [
"figgle"
],
"Description": "<p>Sample product 1 for the ecommerce store.</p>",
"Weighting": 0,
"DisableForSiteSearch": false,
"DisplayName": "DEMO Product 1",
"IsMain": true,
"Items": [
{
"DisplayName": "DEMO Product 3",
"IsMain": false,
"HasGeneratedInventoryProducts": false,
"NumberOfPossibleDownloads": 0,
"MinimumUnits": 0,
"MaximumUnits": 0,
"OnSale": false,
"LargeImage": null,
"EnableDropShipping": false,
"UnitType": null,
"ProductDepth": 0.0000,
"RecurringType": 0,
"ProductHeight": 0.0000,
"IsGiftVoucher": false,
"SKUCode": "7067ce22-6b5d-4bdb-80e6-b878ca0b31f2",
"SmallImage": null,
"ProductWeight": 0.0000,
"ProductWidth": 0.0000,
"IsDownloadable": false,
"InStock": 0,
"IsGroupedProduct": true,
"EnableInventoryControl": false,
"IsShippable": true,
"Price": 0.0,
"RecommendedPrice": 0.0,
"TaxRate": 0.0,
"taxRate": 0.0,
"DecimalsQuantity": 0,
"WhenOutOfStock": 0,
"Supplier": 0,
"DownloadableFileLink": null,
"Id": 2563,
"ModuleLayoutName": "Detail",
"Enabled": true,
"ReleaseDate": "2020-05-19T23:00:00",
"ExpiryDate": "2099-12-11T13:00:00",
"Weighting": 0,
"Item_Rating": 0,
"CodeEditor": false,
"ExternalId": 0,
"DisableForSiteSearch": false,
"Author_Name": null,
"Author_Url": null,
"Author": 0,
"SEOTitle": null,
"CustomProperties": "{}",
"LastUpdatedDate": "2020-05-20T08:35:16",
"Module_Alias": "Product",
"Module_Id": 2485,
"ParentName": null,
"ParentUrl": null,
"Name": "DEMO Product 3",
"UrlSlug": "demo-product-3",
"Url": "/catalogs/demo-product-3",
"MetaDescription": null,
"ShowPageForSearchEngine": false,
"CanonicalLink": null,
"MetaTitle": null,
"ParentId": 2485,
"Url_List": [
"/catalogs/demo-product-3"
],
"ParentId_List": [
-1
],
"EnableAMP": false,
"AMPContent": null,
"SocialMetaTags": null,
"OpenGraphPropertiesValue": null,
"SeoPriority": 0.5,
"Description": null,
"TemplateName": null,
"ItemCategories": null,
"ItemCategoryIdList": null,
"ItemTags": null,
"SiteSearchKeywords": null,
"Items": null,
"IsDisable": false,
"IsHide": false,
"ButtonName": null,
"InventoryProductVariations": [
{
"InStock": 0,
"SKUCode": "7067ce22-6b5d-4bdb-80e6-b878ca0b31f2",
"PreOrder": 0,
"Enabled": true
}
],
"ProductDataJSON": {
"itemId": 2563,
"maximumUnits": 0,
"minimumUnits": 0,
"recommendedPrice": 0.0,
"QuantityThreshold": [
{
"Price": 0.0,
"Quantity": 0
}
],
"inStockTotal": null,
"prices": {
"0": 0.0
},
"enablePreOrder": false,
"variations": null,
"attributes": {},
"options": {},
"taxRate": 0.0,
"taxInPercent": 0.0
},
"VolumeDiscount": [
{
"Price": 0.0,
"Quantity": 0
}
],
"ProductDataJsonHTML": "<script>initEcommerceProductPriceVariations(2563,{\"itemId\":2563,\"maximumUnits\":0,\"minimumUnits\":0,\"recommendedPrice\":0.0,\"QuantityThreshold\":[{\"Price\":0.0,\"Quantity\":0}],\"inStockTotal\":null,\"prices\":{\"0\":0.0},\"enablePreOrder\":false,\"variations\":null,\"attributes\":{},\"options\":{},\"taxRate\":0.0,\"taxInPercent\":0.0});</script>",
"priceWithTax": 0.0,
"RecommendedPriceWithTax": 0.0,
"PriceHtml": "<span data-cms_product_data_price=\"2563\">0.00</span>",
"InStockHtml": "<span data-cms_product_data_in_stock=\"2563\"></span>",
"priceWithTaxHtml": "<span data-cms_product_data_price_with_tax=\"2563\">0.00</span>",
"RecommendedPriceHtml": "<span data-cms_product_data_recommended_price=\"2563\">0.00</span>",
"RecommendedPriceWithTaxHtml": "<span data-cms_product_data_recommended_price_with_tax=\"2563\">0.00</span>",
"ID": 2563,
"CreatedByMemberId": "0",
"IsHome": false,
"Pagination": null,
"OpenGraphProperties": {
"title": null,
"type": null,
"url": null,
"locale": null,
"image": null
},
"Parent": null,
"TemplateVirtualPointer": {
"Pointer": 8491950041332711513,
"TypeId": 1977186194,
"InstanceId": 89,
"DbTypeId": 1977186194,
"DbInstanceId": 89
},
"Params": {}
},
{
"DisplayName": "DEMO Product 1",
"IsMain": true,
"HasGeneratedInventoryProducts": true,
"NumberOfPossibleDownloads": 0,
"MinimumUnits": 0,
"MaximumUnits": 0,
"OnSale": false,
"LargeImage": "/images/template-detail-dinewine-desktop@2x.jpg",
"EnableDropShipping": false,
"UnitType": null,
"ProductDepth": 0.0000,
"RecurringType": 0,
"ProductHeight": 0.0000,
"IsGiftVoucher": false,
"SKUCode": "DEMO1",
"SmallImage": "/images/template-detail-dinewine-mobile@2x.png",
"ProductWeight": 0.0000,
"ProductWidth": 0.0000,
"IsDownloadable": false,
"InStock": 170,
"IsGroupedProduct": true,
"EnableInventoryControl": true,
"IsShippable": true,
"Price": 39.9500,
"RecommendedPrice": 49.9500,
"TaxRate": 0.0400,
"taxRate": 0.0400,
"DecimalsQuantity": 2,
"WhenOutOfStock": 2,
"Supplier": 0,
"DownloadableFileLink": null,
"Id": 2535,
"ModuleLayoutName": "Detail",
"Enabled": true,
"ReleaseDate": "2020-05-04T23:00:00",
"ExpiryDate": "2099-12-11T13:00:00",
"Weighting": 0,
"Item_Rating": 0,
"CodeEditor": false,
"ExternalId": 0,
"DisableForSiteSearch": false,
"Author_Name": null,
"Author_Url": null,
"Author": 0,
"SEOTitle": null,
"CustomProperties": "{\"64748892-87bb-48f5-a82f-9349164884b1\": \"My custom value\"}",
"LastUpdatedDate": "2024-02-23T15:53:52.680317",
"Module_Alias": "Product",
"Module_Id": 2485,
"ParentName": null,
"ParentUrl": null,
"Name": "DEMO Product 1",
"UrlSlug": "demo-product-1",
"Url": "/catalogs/demo-product-1",
"MetaDescription": null,
"ShowPageForSearchEngine": false,
"CanonicalLink": null,
"MetaTitle": null,
"ParentId": 2485,
"Url_List": [
"/catalogs/demo-product-1"
],
"ParentId_List": [
-1
],
"EnableAMP": false,
"AMPContent": null,
"SocialMetaTags": null,
"OpenGraphPropertiesValue": null,
"SeoPriority": 0.5,
"Description": "<p>Sample product 1 for the ecommerce store.</p>",
"TemplateName": null,
"ItemCategories": null,
"ItemCategoryIdList": null,
"ItemTags": null,
"SiteSearchKeywords": [
"figgle"
],
"Items": null,
"IsDisable": false,
"IsHide": false,
"ButtonName": null,
"InventoryProductVariations": [
{
"InStock": 70,
"SKUCode": "DEMO1/Large",
"PreOrder": 0,
"Enabled": true
},
{
"InStock": 0,
"SKUCode": "DEMO1/Medium",
"PreOrder": 0,
"Enabled": true
},
{
"InStock": 100,
"SKUCode": "DEMO1/Small",
"PreOrder": 0,
"Enabled": true
}
],
"ProductDataJSON": {
"itemId": 2535,
"maximumUnits": 0,
"minimumUnits": 0,
"recommendedPrice": 49.9500,
"QuantityThreshold": [
{
"Price": 39.9500,
"Quantity": 0
}
],
"inStockTotal": 170,
"prices": {
"0": 39.9500
},
"enablePreOrder": false,
"variations": {
"4608": {
"id": "4608",
"enabled": true,
"inStock": 70,
"optionIds": [
"3654"
]
},
"4606": {
"id": "4606",
"enabled": true,
"inStock": 0,
"optionIds": [
"3653"
]
},
"4604": {
"id": "4604",
"enabled": true,
"inStock": 100,
"optionIds": [
"3652"
]
}
},
"attributes": {
"3661": {
"id": "3661",
"isInventory": true,
"name": "Size",
"type": 2,
"required": true,
"optionIds": [
"3652",
"3653",
"3654"
]
}
},
"options": {
"3652": {
"id": "3652",
"attributeId": "3661",
"name": "Small",
"image": "/images/template-detail-crafter-mobile.png",
"price": 0.0000
},
"3653": {
"id": "3653",
"attributeId": "3661",
"name": "Medium",
"image": "/images/template-crafter@2x.jpg",
"price": 2.0000
},
"3654": {
"id": "3654",
"attributeId": "3661",
"name": "Large",
"image": "/images/template-detail-crafter-desktop@2x.jpg",
"price": 4.0000
}
},
"taxRate": 0.0400,
"taxInPercent": 4.0000
},
"VolumeDiscount": [
{
"Price": 39.9500,
"Quantity": 0
}
],
"ProductDataJsonHTML": "<script>initEcommerceProductPriceVariations(2535,{\"itemId\":2535,\"maximumUnits\":0,\"minimumUnits\":0,\"recommendedPrice\":49.9500,\"QuantityThreshold\":[{\"Price\":39.9500,\"Quantity\":0}],\"inStockTotal\":170,\"prices\":{\"0\":39.9500},\"enablePreOrder\":false,\"variations\":{\"4608\":{\"id\":\"4608\",\"enabled\":true,\"inStock\":70,\"optionIds\":[\"3654\"]},\"4606\":{\"id\":\"4606\",\"enabled\":true,\"inStock\":0,\"optionIds\":[\"3653\"]},\"4604\":{\"id\":\"4604\",\"enabled\":true,\"inStock\":100,\"optionIds\":[\"3652\"]}},\"attributes\":{\"3661\":{\"id\":\"3661\",\"isInventory\":true,\"name\":\"Size\",\"type\":2,\"required\":true,\"optionIds\":[\"3652\",\"3653\",\"3654\"]}},\"options\":{\"3652\":{\"id\":\"3652\",\"attributeId\":\"3661\",\"name\":\"Small\",\"image\":\"/images/template-detail-crafter-mobile.png\",\"price\":0.0000},\"3653\":{\"id\":\"3653\",\"attributeId\":\"3661\",\"name\":\"Medium\",\"image\":\"/images/template-crafter@2x.jpg\",\"price\":2.0000},\"3654\":{\"id\":\"3654\",\"attributeId\":\"3661\",\"name\":\"Large\",\"image\":\"/images/template-detail-crafter-desktop@2x.jpg\",\"price\":4.0000}},\"taxRate\":0.0400,\"taxInPercent\":4.0000});</script>",
"priceWithTax": 41.55,
"RecommendedPriceWithTax": 51.95,
"PriceHtml": "<span data-cms_product_data_price=\"2535\">39.95</span>",
"InStockHtml": "<span data-cms_product_data_in_stock=\"2535\">170</span>",
"priceWithTaxHtml": "<span data-cms_product_data_price_with_tax=\"2535\">41.55</span>",
"RecommendedPriceHtml": "<span data-cms_product_data_recommended_price=\"2535\">49.95</span>",
"RecommendedPriceWithTaxHtml": "<span data-cms_product_data_recommended_price_with_tax=\"2535\">51.95</span>",
"ID": 2535,
"CreatedByMemberId": "0",
"IsHome": false,
"Pagination": null,
"OpenGraphProperties": {
"title": null,
"type": null,
"url": null,
"locale": null,
"image": null
},
"Parent": null,
"TemplateVirtualPointer": {
"Pointer": 8491950041332711513,
"TypeId": 1977186194,
"InstanceId": 89,
"DbTypeId": 1977186194,
"DbInstanceId": 89
},
"Params": {}
},
{
"DisplayName": "DEMO product 2",
"IsMain": false,
"HasGeneratedInventoryProducts": false,
"NumberOfPossibleDownloads": 0,
"MinimumUnits": 0,
"MaximumUnits": 0,
"OnSale": false,
"LargeImage": "/images/template-detail-crafter-desktop@2x.jpg",
"EnableDropShipping": false,
"UnitType": null,
"ProductDepth": 0.0000,
"RecurringType": 0,
"ProductHeight": 0.0000,
"IsGiftVoucher": false,
"SKUCode": "DEMO2",
"SmallImage": "/images/template-detail-crafter-mobile@2x.png",
"ProductWeight": 0.0000,
"ProductWidth": 0.0000,
"IsDownloadable": false,
"InStock": 0,
"IsGroupedProduct": true,
"EnableInventoryControl": false,
"IsShippable": true,
"Price": 0.0,
"RecommendedPrice": 0.0,
"TaxRate": 0.0,
"taxRate": 0.0,
"DecimalsQuantity": 0,
"WhenOutOfStock": 0,
"Supplier": 0,
"DownloadableFileLink": null,
"Id": 2536,
"ModuleLayoutName": "Detail",
"Enabled": true,
"ReleaseDate": "2020-05-05T23:00:00",
"ExpiryDate": "2099-12-11T13:00:00",
"Weighting": 0,
"Item_Rating": 0,
"CodeEditor": false,
"ExternalId": 0,
"DisableForSiteSearch": false,
"Author_Name": null,
"Author_Url": null,
"Author": 0,
"SEOTitle": null,
"CustomProperties": "{}",
"LastUpdatedDate": "2020-05-20T08:35:14",
"Module_Alias": "Product",
"Module_Id": 2485,
"ParentName": null,
"ParentUrl": null,
"Name": "DEMO product 2",
"UrlSlug": "demo-product-2",
"Url": "/catalogs/demo-product-2",
"MetaDescription": null,
"ShowPageForSearchEngine": false,
"CanonicalLink": null,
"MetaTitle": null,
"ParentId": 2485,
"Url_List": [
"/catalogs/demo-product-2"
],
"ParentId_List": [
-1
],
"EnableAMP": false,
"AMPContent": null,
"SocialMetaTags": null,
"OpenGraphPropertiesValue": null,
"SeoPriority": 0.5,
"Description": "<p>Sample product for the ecommerce store.</p>",
"TemplateName": null,
"ItemCategories": null,
"ItemCategoryIdList": null,
"ItemTags": null,
"SiteSearchKeywords": null,
"Items": null,
"IsDisable": false,
"IsHide": false,
"ButtonName": null,
"InventoryProductVariations": [
{
"InStock": 0,
"SKUCode": "DEMO2",
"PreOrder": 0,
"Enabled": true
}
],
"ProductDataJSON": {
"itemId": 2536,
"maximumUnits": 0,
"minimumUnits": 0,
"recommendedPrice": 0.0,
"QuantityThreshold": [
{
"Price": 0.0,
"Quantity": 0
}
],
"inStockTotal": null,
"prices": {
"0": 0.0
},
"enablePreOrder": false,
"variations": null,
"attributes": {},
"options": {},
"taxRate": 0.0,
"taxInPercent": 0.0
},
"VolumeDiscount": [
{
"Price": 0.0,
"Quantity": 0
}
],
"ProductDataJsonHTML": "<script>initEcommerceProductPriceVariations(2536,{\"itemId\":2536,\"maximumUnits\":0,\"minimumUnits\":0,\"recommendedPrice\":0.0,\"QuantityThreshold\":[{\"Price\":0.0,\"Quantity\":0}],\"inStockTotal\":null,\"prices\":{\"0\":0.0},\"enablePreOrder\":false,\"variations\":null,\"attributes\":{},\"options\":{},\"taxRate\":0.0,\"taxInPercent\":0.0});</script>",
"priceWithTax": 0.0,
"RecommendedPriceWithTax": 0.0,
"PriceHtml": "<span data-cms_product_data_price=\"2536\">0.00</span>",
"InStockHtml": "<span data-cms_product_data_in_stock=\"2536\"></span>",
"priceWithTaxHtml": "<span data-cms_product_data_price_with_tax=\"2536\">0.00</span>",
"RecommendedPriceHtml": "<span data-cms_product_data_recommended_price=\"2536\">0.00</span>",
"RecommendedPriceWithTaxHtml": "<span data-cms_product_data_recommended_price_with_tax=\"2536\">0.00</span>",
"ID": 2536,
"CreatedByMemberId": "0",
"IsHome": false,
"Pagination": null,
"OpenGraphProperties": {
"title": null,
"type": null,
"url": null,
"locale": null,
"image": null
},
"Parent": null,
"TemplateVirtualPointer": {
"Pointer": 8491950041332711513,
"TypeId": 1977186194,
"InstanceId": 89,
"DbTypeId": 1977186194,
"DbInstanceId": 89
},
"Params": {}
}
],
"SKUCode": "DEMO1",
"SmallImage": "/images/template-detail-dinewine-mobile@2x.png",
"LargeImage": "/images/template-detail-dinewine-desktop@2x.jpg",
"OnSale": false,
"IsGiftVoucher": false,
"ProductWeight": 0.0000,
"ProductWidth": 0.0000,
"ProductHeight": 0.0000,
"ProductDepth": 0.0000,
"EnableDropShipping": false,
"UnitType": "",
"MinimumUnits": 0,
"MaximumUnits": 0,
"RecurringType": "None",
"IsShippable": true,
"IsDownloadable": false,
"NumberOfPossibleDownloads": 0,
"Supplier": 0,
"Price": 39.9500,
"PriceHtml": "<span data-cms_product_data_price=\"2535\">39.95</span>",
"priceWithTax": 41.55,
"priceWithTaxHtml": "<span data-cms_product_data_price_with_tax=\"2535\">41.55</span>",
"RecommendedPriceWithTax": 51.95,
"RecommendedPriceWithTaxHtml": "<span data-cms_product_data_recommended_price_with_tax=\"2535\">51.95</span>",
"RecommendedPrice": 49.9500,
"RecommendedPriceHtml": "<span data-cms_product_data_recommended_price=\"2535\">49.95</span>",
"EnableInventoryControl": true,
"HasGeneratedInventoryProducts": true,
"InStockHtml": "<span data-cms_product_data_in_stock=\"2535\">170</span>",
"IsHide": false,
"InStock": 170,
"IsDisable": false,
"taxRate": 0.0400,
"IsGroupedProduct": true,
"decimalsQuantity": 2,
"VolumeDiscount": [
{
"Price": 39.9500,
"Quantity": 0
}
],
"ProductDataJSON": {
"itemId": 2535,
"maximumUnits": 0,
"minimumUnits": 0,
"recommendedPrice": 49.9500,
"QuantityThreshold": [
{
"Price": 39.9500,
"Quantity": 0
}
],
"inStockTotal": 170,
"prices": {
"0": 39.9500
},
"enablePreOrder": false,
"variations": {
"4608": {
"id": "4608",
"enabled": true,
"inStock": 70,
"optionIds": [
"3654"
]
},
"4606": {
"id": "4606",
"enabled": true,
"inStock": 0,
"optionIds": [
"3653"
]
},
"4604": {
"id": "4604",
"enabled": true,
"inStock": 100,
"optionIds": [
"3652"
]
}
},
"attributes": {
"3661": {
"id": "3661",
"isInventory": true,
"name": "Size",
"type": 2,
"required": true,
"optionIds": [
"3652",
"3653",
"3654"
]
}
},
"options": {
"3652": {
"id": "3652",
"attributeId": "3661",
"name": "Small",
"image": "/images/template-detail-crafter-mobile.png",
"price": 0.0000
},
"3653": {
"id": "3653",
"attributeId": "3661",
"name": "Medium",
"image": "/images/template-crafter@2x.jpg",
"price": 2.0000
},
"3654": {
"id": "3654",
"attributeId": "3661",
"name": "Large",
"image": "/images/template-detail-crafter-desktop@2x.jpg",
"price": 4.0000
}
},
"taxRate": 0.0400,
"taxInPercent": 4.0000
},
"ProductDataJsonHTML": "<script>initEcommerceProductPriceVariations(2535,{\"itemId\":2535,\"maximumUnits\":0,\"minimumUnits\":0,\"recommendedPrice\":49.9500,\"QuantityThreshold\":[{\"Price\":39.9500,\"Quantity\":0}],\"inStockTotal\":170,\"prices\":{\"0\":39.9500},\"enablePreOrder\":false,\"variations\":{\"4608\":{\"id\":\"4608\",\"enabled\":true,\"inStock\":70,\"optionIds\":[\"3654\"]},\"4606\":{\"id\":\"4606\",\"enabled\":true,\"inStock\":0,\"optionIds\":[\"3653\"]},\"4604\":{\"id\":\"4604\",\"enabled\":true,\"inStock\":100,\"optionIds\":[\"3652\"]}},\"attributes\":{\"3661\":{\"id\":\"3661\",\"isInventory\":true,\"name\":\"Size\",\"type\":2,\"required\":true,\"optionIds\":[\"3652\",\"3653\",\"3654\"]}},\"options\":{\"3652\":{\"id\":\"3652\",\"attributeId\":\"3661\",\"name\":\"Small\",\"image\":\"/images/template-detail-crafter-mobile.png\",\"price\":0.0000},\"3653\":{\"id\":\"3653\",\"attributeId\":\"3661\",\"name\":\"Medium\",\"image\":\"/images/template-crafter@2x.jpg\",\"price\":2.0000},\"3654\":{\"id\":\"3654\",\"attributeId\":\"3661\",\"name\":\"Large\",\"image\":\"/images/template-detail-crafter-desktop@2x.jpg\",\"price\":4.0000}},\"taxRate\":0.0400,\"taxInPercent\":4.0000});</script>",
"CreatedByMemberId": "0",
"ItemCategories": [],
"ItemCategoryIdList": [],
"ItemTags": [],
"Author": 0,
"Author_Name": "",
"Author_Url": "",
"Item_Rating": 0,
"MyCustomProperty": "My custom value",
"ShowPageForSearchEngine": false,
"MetaTitle": "",
"SEOTitle": "",
"MetaDescription": "",
"CanonicalLink": "",
"SocialMetaTags": "",
"SeoPriority": 0.5,
"EnableAMP": false,
"AMPContent": "",
"OpenGraphProperties": {
"title": null,
"type": null,
"url": null,
"locale": null,
"image": null
},
"ExternalId": 0,
"Params": {}
}
Virtual Layout
Based on the above example, if not using any custom layout or collection, the default virtual layout will output as a form select element:
{% if this.items != null %}
<select data-cms_grouped_products_selector onchange="window.cmsGroupedProductsChange(this)">
{% for item in this.items %}
<option value="{{item.id}}" data-product_url="{{item.Url}}" {% if this.id == item.id %} selected="selected" {% endif %}>{{item.displayName}}</option>
{% endfor %}
</select>
{% endif %}
Rendering the form element:
Accessing the Data
JSON Output
You can output the full JSON for your component data by referencing the root Liquid object {{this}}
in your module’s layouts, or directly on your page, if using the collectionVariable
parameter in your component tag.
For example:
{% component type: ... collectionVariable: "myData" %}
You can then render the JSON like so:
{{myData}}
For more details on using this approach, see Part 2 of the free ‘Learning Liquid Course’.
Rendering Property Values
This data is also accessible directly on the Page or Template via a Liquid Collection by adding collectionVariable
to the Component.
An example using collectionVariable
with value "groupedCollection":
{% component type:"grouped_items", source: "Products", itemId: "2535", collectionVariable: "groupedCollection" %}
Accessing a specific item within the collection. In this case the first item (zero based index), which in our example would render the value DEMO Product 3
{{groupedCollection.items[0]['Name']}}