on 2019 Apr 05 5:08 PM
In impex file, I create a mediamodel entry, which is a png file.
Would I know if there is any example how to show this media model on frontend?
Request clarification before answering.
Hi Guangwei
Have a look at the AbstractProductImagePopulator which is responsible for converting MediaModel to ImageData. Once you have ImageData populated, you can display the image on the front end by using the following.
<c:set value="${ycommerce:productImage(product, <media format to display>)}" var="productImage"/>
<img src="${productImage.url}" alt="${fn:escapeXml(product.name)}" title="${fn:escapeXml(product.name)}" />
ycommerce:productImage calls getPrimaryImageForProductAndFormat in de.hybris.platform.acceleratorstorefrontcommons.tags.Functions class
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.