Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hi,
Viewing a product image is fairly straightforward:
var url = CatalogLibrary.GetNiceUrlForProduct(product); @if (!string.IsNullOrEmpty(product.ThumbnailImageMediaId)) { dynamic mediaItem = new DynamicMedia(product.ThumbnailImageMediaId); <a href="@url"><img src="@mediaItem.umbracoFile" /></a> }
However, I am struggling to make a variant image visible (if it exists)
I have added an image from the media library to each variant:
But cannot work out how to display it as it does not have a ThumbnailImageMediaId.
Any assistance would be greatly appreciated.
Thanks in advance
Hello Chris.
I believe the Image you've added is a custom property from a definitionField you've called Image. You should use product["Image"].Value.
Best regards
Morten
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.
Continue discussion
Displaying Variant Image
Hi,
Viewing a product image is fairly straightforward:
However, I am struggling to make a variant image visible (if it exists)
I have added an image from the media library to each variant:
But cannot work out how to display it as it does not have a ThumbnailImageMediaId.
Any assistance would be greatly appreciated.
Thanks in advance
Hello Chris.
I believe the Image you've added is a custom property from a definitionField you've called Image. You should use product["Image"].Value.
Best regards
Morten
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.