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

duplicate title

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 02-05-2008, 11:31 AM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,190
 

Default duplicate title

I am trying to validate the code on my site and I came across the following: on the pages where "Sort by" and/or page navigation bar is shown I get duplicate titles like this

<td class="SearchSortCell"><a class="SearchSortLink" href="cat-6-network-price-up-c-315.html" title="Sort by: Price" title="Cat 6 Network">Price</a></td>

same goes for the page links

<td class="NavigationCell"><a href="firewire-orderby-up-c-324-p-2.html" title="Page #2" title="FireWire">2</a><img src="/store_us/images/spacer.gif" alt="" /></td>

it looks to me that this happens when the above results are called in {foreach} statement.

the strange thing is: if I login as a customer the second "title" is not there anymore so everything is just the way it's supposed to be.
Is this the normal x-cart behaviour (it shoudn't be) or I did something wrong? Any ideas what can cause this?
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote
  #2  
Old 02-05-2008, 01:58 PM
  kube's Avatar 
kube kube is offline
 

X-Adept
  
Join Date: Sep 2005
Location: London: a small place East of Wales
Posts: 529
 

Default Re: duplicate title

No, it's not the default x-cart behaviour.

It appears your url-friendly mod is adding the additional title but neglects to replace the default title. I think the default titles coming from x-cart are the first titles you have printed, ie. "Sort by: Price" & "Page #2".

What mod are you using to modify your URLs? XC-SEO?
__________________
Doms
kube v4.1.9
Reply With Quote
  #3  
Old 02-05-2008, 02:55 PM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,190
 

Default Re: duplicate title

yes the 1st title is the default and actually is the one i want to have there. and yes it is XC-SEO. hm i should have look at the php files for this mode. any suggestions?
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote
  #4  
Old 02-05-2008, 03:38 PM
  kube's Avatar 
kube kube is offline
 

X-Adept
  
Join Date: Sep 2005
Location: London: a small place East of Wales
Posts: 529
 

Default Re: duplicate title

Crumbs, it was a while since I done this. But the answer was provided by a kind fellow somewhere within the XC-SEO thread. Looks like this one by cbarnes http://forum.x-cart.com/showpost.php?p=196528&postcount=367

Go into modules/XC_SEO/outputfilter.seo.php and find the function _insert_href_title()

right below it inside the function, find the line...

if((strpos(" title=",$found)===false)){

and change to this...

if((eregi("title=",$found)===false)){

Can't remember if the code needed changes .tpl-wise - I doubt it though. (Well except for the addition of the title tag which should take prominence outside of the XC-SEO mod)

Remember to back up, just in case ;D

Hope this helps.
Regards,
Doms
__________________
Doms
kube v4.1.9
Reply With Quote
  #5  
Old 02-05-2008, 04:13 PM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,190
 

Default Re: duplicate title

I was looking at this php file cause you mention XC_SEO, found the fuction and I was playing with it without any success untill now. Thanks kube that worked out. Appreciated. But... well there is another problem now. Some of my links are like "Something somthing 15" something something" so now I get the error that the title closes after the "15" because of the ". How I correct this? How I tell this function in XC_SEO to ignore any " in title?
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote
  #6  
Old 02-05-2008, 04:50 PM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,190
 

Default Re: duplicate title

never mind fixed it. Kube thanks for the link. nice fix of XC_SEO.
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote
  #7  
Old 06-04-2008, 07:05 AM
  Holub's Avatar 
Holub Holub is offline
 

X-Adept
  
Join Date: Jan 2008
Posts: 432
 

Default Re: duplicate title

Quote:
Originally Posted by kube
Go into modules/XC_SEO/outputfilter.seo.php and find the function _insert_href_title()

right below it inside the function, find the line...

if((strpos(" title=",$found)===false)){

and change to this...

if((eregi("title=",$found)===false)){

I don't think that it is good idea because any regular expressions works very slowly than strpos. Therefore more better solution is change strpos( ' title=', $found) to strpos($found, ' title=')

crossposted in http://forum.x-cart.com/showthread.php?p=218937#post218937
__________________
Regards,
Anthony Holub

X-Cart Skins Store
- twenty two different skins available;
- both 4.1.x and 4.2.x versions compatible;
- refresh you store now!

Smart menu X-Cart add-on
Featured Products Slide Show X-Cart add-on
"What's New?" FREE X-Cart add-on
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 12:09 AM.

   

 
X-Cart forums © 2001-2020