Jump to content

Images missing width and/or height attribute


Yakje

Recommended Posts

I ran my website through http://gtmetrix.com/ and the following issue came up:

 

The following image(s) are missing width and/or height attributes.

I noticed that all the images above are images featured in the homepage modules: "blocknewproducts", "blockbestsellers" & "blockspecials" 

post-939155-0-82432700-1427297816_thumb.jpg

You can take a look at my site over here:

http://goo.gl/RqgDpw

 

So it seems to me that something is wrong about the coding in those modules?

I was hoping for anyone who knows how to get this fixed?

Link to comment
Share on other sites

  • 1 month later...

You could check if your file:  themes/<your theme folder>/modules/blockspecials/blockspecials.tpl:  (make backup!!)

has the following red line defined :

 

<div class="left-block">
  <div class="product-image-container">
    <a class="product_img_link" href="{$product.link|escape:'html':'UTF-8'}" title="{$product.name|escape:'html':'UTF-8'}" itemprop="url">
      <img class="replace-2x img-responsive" src="{$link->getImageLink($product.link_rewrite, $product.id_image, 'home_default')|escape:'html':'UTF-8'}" alt="{if !empty($product.legend)}{$product.legend|escape:'html':'UTF-8'}{else}{$product.name|escape:'html':'UTF-8'}{/if}" title="{if !empty($product.legend)}{$product.legend|escape:'html':'UTF-8'}{else}{$product.name|escape:'html':'UTF-8'}{/if}" {if isset($homeSize)} width="{$homeSize.width}" height="{$homeSize.height}"{/if} itemprop="image" />
    </a>
 
Link to comment
Share on other sites

  • 1 month later...

I ran my website through http://gtmetrix.com/ and the following issue came up:

 

The following image(s) are missing width and/or height attributes.

I noticed that all the images above are images featured in the homepage modules: "blocknewproducts", "blockbestsellers" & "blockspecials" 

attachicon.gifimage-dimensions.jpg

You can take a look at my site over here:

http://goo.gl/RqgDpw

 

So it seems to me that something is wrong about the coding in those modules?

I was hoping for anyone who knows how to get this fixed?

did you solve it?

Link to comment
Share on other sites

  • 1 month later...

hello

i have the same issue, i tried to add this in the module tpl/modules/blockspecials/blockspecials.tpl

<a class="products-block-image" href="{$special.link|escape:'html':'UTF-8'}">
                    <img
                    class="replace-2x img-responsive"
                    src="{$link->getImageLink($special.link_rewrite, $special.id_image, 'small_default')|escape:'html':'UTF-8'}"
                    alt="{$special.legend|escape:'html':'UTF-8'}"
                    title="{$special.name|escape:'html':'UTF-8'}" {if isset($small_defaultSize)} width="{$small_defaultSize.width}" height="{$small_defaultSize.height}"{/if} />
                </a>

i tried all kind of thins homeSize, as you posted above, small Size. nothin changes i still do not have sizes on my developper tool from firefox. anyone could help.

thanks a lot.

it works with medium size and home size ont block new products but not with small size, i don't know why.

Edited by cockpitinferno (see edit history)
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...