Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

is there a better way to do this?

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 04-06-2015, 12:02 PM
 
keystone keystone is offline
 

X-Adept
  
Join Date: Jul 2006
Location: USA
Posts: 787
 

Default 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?
__________________
www.uscandleco.com - X-Cart Version 4.7.11 Gold Plus php7.3
mods:
reCaptcha
running on UNIX

www.keystonecandle.com X-Cart Gold Plus - Version 4.7.11 php7.2
mods:
reCaptcha
cdseo pro
running on UNIX
Reply With Quote
  #2  
Old 04-06-2015, 02:33 PM
  Jon's Avatar 
Jon Jon is offline
 

X-Guru
  
Join Date: Oct 2002
Location: Vancouver, Canada
Posts: 4,200
 

Default 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}
Reply With Quote
  #3  
Old 04-06-2015, 09:41 PM
 
PhilJ PhilJ is offline
 

X-Guru
  
Join Date: Nov 2002
Posts: 4,094
 

Default 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.
__________________
xcartmods.co.uk
Reply With Quote
  #4  
Old 04-07-2015, 06:13 AM
 
keystone keystone is offline
 

X-Adept
  
Join Date: Jul 2006
Location: USA
Posts: 787
 

Default 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.
__________________
www.uscandleco.com - X-Cart Version 4.7.11 Gold Plus php7.3
mods:
reCaptcha
running on UNIX

www.keystonecandle.com X-Cart Gold Plus - Version 4.7.11 php7.2
mods:
reCaptcha
cdseo pro
running on UNIX
Reply With Quote
  #5  
Old 04-07-2015, 06:45 AM
 
keystone keystone is offline
 

X-Adept
  
Join Date: Jul 2006
Location: USA
Posts: 787
 

Default Re: is there a better way to do this?

phil, just sent you a pm
__________________
www.uscandleco.com - X-Cart Version 4.7.11 Gold Plus php7.3
mods:
reCaptcha
running on UNIX

www.keystonecandle.com X-Cart Gold Plus - Version 4.7.11 php7.2
mods:
reCaptcha
cdseo pro
running on UNIX
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 01:54 AM.

   

 
X-Cart forums © 2001-2020