Last active
February 24, 2025 02:11
-
-
Save 4e6ka/fb0e5fce3bc20c0676470858a68e285c to your computer and use it in GitHub Desktop.
Fenom и изображения в каталоге и на карточке
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Выводим в шаблоне категории список товаров так: | |
[[!pdoPage? | |
&element=`msProducts` | |
&loadModels=`gallery` | |
&leftJoin=`{ | |
"360x270": {"class":"msProductFile","alias":"360x270", "on": "360x270.product_id = msProduct.id AND 360x270.path LIKE '%/360x270/' AND 360x270.rank=0"} | |
,"360x270x1": {"class":"msProductFile","alias":"360x270x1", "on": "360x270x1.product_id = msProduct.id AND 360x270x1.path LIKE '%/360x270/' AND 360x270x1.rank=1"} | |
}` | |
&select=`{ | |
"msProduct":"*" | |
,"360x270":"360x270.url as 360x270" | |
,"360x270x1":"360x270x1.url as 360x270x1" | |
}` | |
]] | |
и в чанке tpl.msProducts.row.php вывожу ДВА фото товара так: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<img src="[[+360x270:default=`[[++assets_url]]components/minishop2/img/web/ms2_small.png`]]"> | |
<img src="[[+360x270x1:default=`[[++assets_url]]components/minishop2/img/web/ms2_small.png`]]"> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment