X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   is there a better way to do this? (https://forum.x-cart.com/showthread.php?t=71778)

keystone 04-06-2015 12:02 PM

is there a better way to do this?
 
I have the ReBOOT template installed on my www.uscandleco.com site. I ran the w3c validator on my home page and it gave me around 40 errors. One of them is this
Quote:

Line 1, Column 10949: Duplicate attribute width.
┘co.com/images/T/xctmpH0L3vi.png" width="140" height="140" alt="Outdoor Pillar ┘


the thumbnail template is this...
Code:

{strip}
<span itemprop="image" content="{$tmbn_url}">
<img itemprop="image" class="lazy"
{if $id ne ''} id="{$id}"{/if}
{if !$notlazy} src="{$AltImagesDir}/spacer.gif"{if $image_x ne 0} width="{$image_x}"{/if}{if $image_y ne 0} height="{$image_y}"{/if} data-src="{else}src="{/if}
{if $tmbn_url}
{$tmbn_url|amp}
{else}
{if $full_url}
{$current_location}
{else}
{$xcart_web_dir}
{/if}
/image.php?type={$type|default:"T"}&amp;id={$productid}
{/if}
"
{if $image_x ne 0} width="{$image_x}"{/if}
{if $image_y ne 0} height="{$image_y}"{/if} alt="{$product|escape}" title="{$product|escape}" />
</span>
{/strip}


Is the if statement not quite right? I have duplicate width and heights on each thumbnail image throughout my entire site.

It seems as if the one set is for the spacer.gif and the other is for the actual thumbnail.

Any suggestions?

Jon 04-06-2015 02:33 PM

Re: is there a better way to do this?
 
Looks to me like these lines:

Code:

{if $image_x ne 0} width="{$image_x}"{/if}
{if $image_y ne 0} height="{$image_y}"{/if} alt="{$product|escape}" title="{$product|escape}" />


Should read:

Code:

{if $notlazy}
{if $image_x ne 0} width="{$image_x}"{/if}
{if $image_y ne 0} height="{$image_y}"{/if} alt="{$product|escape}" title="{$product|escape}" />
{/if}


PhilJ 04-06-2015 09:41 PM

Re: is there a better way to do this?
 
Hi Pete, spacer.gif is the placeholder image for the lazy loader.

In skin/reboot/product_thumbnail.tpl you can replace...
Code:

{if !$notlazy} src="{$AltImagesDir}/spacer.gif"{if $image_x ne 0} width="{$image_x}"{/if}{if $image_y ne 0} height="{$image_y}"{/if} data-src="{else}src="{/if}
With...
Code:

{if !$notlazy} src="{$AltImagesDir}/spacer.gif" data-src="{else}src="{/if}
The {if !$notlazy} code is correct as it is.

keystone 04-07-2015 06:13 AM

Re: is there a better way to do this?
 
Thanks Jon for the response. Phil, I wasn't sure if it would have affected anything negatively if I changed the line to what your suggestion was. That was going to be the first thing I tried but wanted to ask first.

Thanks.

keystone 04-07-2015 06:45 AM

Re: is there a better way to do this?
 
phil, just sent you a pm


All times are GMT -8. The time now is 05:15 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.