relations[] is non-emptysettings.header)relation.selectedProducts[]viewItemList when the carousel enters the viewport{
"relations": [
{
"title": "Sample title",
"selectedProducts": [
{
"id": "Product Id",
"title": "Sample product title",
"link": "product/sample-product",
"mediaItems": [
{
"id": "Media Item Id",
"link": "https://example.com/media/sample.jpg",
"position": 0,
"alt": "sample.jpg",
"mediaType": "Image"
},
"..."
],
"productVariants": [
{
"id": "Variant Id",
"finalPriceText": "Sample price text",
"finalPrice": 10
},
"..."
],
"dimension1": {
"attributeId": "Attribute Id",
"type": "Color",
"items": [
{
"id": "Attribute Item Id",
"value": "Sample text"
},
"..."
]
},
"dimension2": {
"attributeId": "Attribute Id",
"type": "Size",
"items": [
{
"id": "Attribute Item Id",
"value": "S"
},
"..."
]
}
},
"..."
]
},
"..."
],
"name": "RelatedProducts",
"view": "Default",
"section": "SectionA",
"settings": {
"relatedProductsAssociationType": "Product",
"id": "Component Id",
"section": "SectionA",
"type": "NoirRelatedProducts",
"name": "RelatedProducts",
"configuredInContentApi": true,
"view": "Default",
"displayName": "",
"cssClass": "",
"header": "Sample text",
"alignment": "Left"
},
"translations": {
"relatedProducts": "Sample text"
}
}settings.idsettings.cssClasssettings.header (main header for the whole section)settings.alignment (Left, Center, Right)relations[]relation.titlerelation.selectedProducts[]translations.relatedProductsComponents/RelatedProducts/Default.js exposes:<div x-data='relatedproductsdefault.initComponent("{{ relationId }}", {{ products | serialize | escape }}, "{{ relation.Title | default: model.Translations.RelatedProducts }}")'>initComponent(id, products, headerTitle)init()viewItemList when 25% of the carousel is visible.elementInView("#products-carousel-" + id, ...), so carousel ids must match Liquid.swiperInit(id)#products-carousel-<id>..swiper-pagination-<id>.>= 1024: 4 per viewslides.length > 4.Reusables\\ProductGridItem\\DefaultelementInView(...)prepareListProducts(...)sendGAEvent(...)settings.header is optional; relation titles can be shown per relation.alignmentClass from settings.alignment.relationId as <componentId>-<index> so multiple carousels on the same page don’t collide.colorExists for the relation by scanning products for a Color dimension.