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)
-   -   duplicate title (https://forum.x-cart.com/showthread.php?t=37346)

cflsystems 02-05-2008 11:31 AM

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?

kube 02-05-2008 01:58 PM

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?

cflsystems 02-05-2008 02:55 PM

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?

kube 02-05-2008 03:38 PM

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

cflsystems 02-05-2008 04:13 PM

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?

cflsystems 02-05-2008 04:50 PM

Re: duplicate title
 
never mind fixed it. Kube thanks for the link. nice fix of XC_SEO.

Holub 06-04-2008 07:05 AM

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


All times are GMT -8. The time now is 06:20 PM.

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