Answer the question
In order to leave comments, you need to log in
How to display multiple images in a catalog product card using the msProducts snippet?
I have a list of products in the catalog through the msProducts snippet
{$_modx->runSnippet('msProducts', [
'parents' => 5,
'includeThumbs' => 'middle,retinamiddle',
'tpl'=> '@FILE chunks/product.tpl'
])}
<li>
<h3>{$pagetitle}</h3>
<figure>
{$_modx->runSnippet('msGallery', [
'product' => $id,
'tpl'=> '@FILE chunks/middle_images.tpl'
])}
</figure>
</li>
{foreach $files as $file}
<img src="{$file['middle']}" srcset="{$file['retinamiddle']} 2x">
{/foreach}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question