You are here:  » improving title tags


improving title tags

Submitted by sgpratley on Fri, 2006-05-12 12:49 in

The tags for the index page and product pages are great, but is there any way to get rid of the "merchant:" bit on the merchant pages? also brand & category that behave in the same way

so I would just see "John Lewis" rather than "merchant:John Lewis"

Submitted by support on Fri, 2006-05-12 13:00

Hi,

The title is basically just the query, which is in the script as the $q variable, and assigned to the title in this line of search.php (line 320 in the distribution):

$header["title"] = htmlentities($q,ENT_QUOTES,$config_charset);

To remove the merchant, category and brand tags, simply change this to the following:

$header["title"] = $q;
$header["title"] = str_replace("merchant:","",$header["title"]);
$header["title"] = str_replace("category:","",$header["title"]);
$header["title"] = str_replace("brand:","",$header["title"]);

Should do the trick..!

Cheers,
David.

Edit: Updated for distribution 12/10B

Submitted by philstone on Fri, 2006-05-12 14:35

What a genius bit of code!

Is there anyway of putting a space after the "merchant name" and taking out the ":", so instead of being

Buy24-7.net : Advanced MP3 Players: - Price Comparison Website, it would be
Buy24-7.net : Advanced MP3 Players - Price Comparison Website

thanks

phil

Submitted by support on Fri, 2006-05-12 15:03

Ah forgot about the ":" after; try adding this line as well:

$header["title"] = str_replace(":"," ",$header["title"]);