Jump to content

Add dimension in image url


Mircea Zaharia

Recommended Posts

Hello, @Mircea Zaharia

 

Please use this

{if isset($product.cover.bySize)} width="{$product.cover.bySize.home_default.width}" height="{$product.cover.bySize.home_default.height}"{/if}

code like 

 

   <img {if isset($product.cover.bySize)} width="{$product.cover.bySize.home_default.width}" height="{$product.cover.bySize.home_default.height}"{/if}
              src="{$product.cover.bySize.home_default.url}"
              alt="{if !empty($product.cover.legend)}{$product.cover.legend}{else}{$product.name|truncate:30:'...'}{/if}"
              data-full-size-image-url="{$product.cover.large.url}"
              />

 

 

It will be like that. https://pscreenshot.com/i/h5cR27


Thank you

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...