You are here:  » Brand meta tags

Support Forum



Brand meta tags

Submitted by kiddaclo on Sun, 2010-02-14 14:35 in

Hi David,

I'd like to add meta tags to my brand pages what would be best way to do this?

I have added code to search.php for the description and keywords but how can I insert just the actual brand into them without including the brand: and : bit?

Submitted by support on Mon, 2010-02-15 09:48

Hi,

The query is actually split up into the $parts array; so when $parts[0] is "brand", the brand name without any additional characters is in $parts[1], so you could use something like:

if ($parts[0]=="brand")
{
  $header["meta"]["keywords"] = "Search results for the brand ".$parts[1];
}

Hope this helps!

Cheers,
David.

Submitted by kiddaclo on Mon, 2010-02-15 23:50

Hi David,

Thanks for that. I have been messing around with it and is it ok to do it like this? It all seems to work ok.

    $header["title"] = htmlentities($q,ENT_QUOTES,$config_charset);
if ($parts[0]=="brand")
{
 $header["title"] = "Compare $parts[1] prices";
 $header["meta"]["keywords"] = "blah,buy $parts[1],$parts[1] deals,compare,prices";
 $header["meta"]["description"] = "Compare $parts[1] prices blah blah blah blah great $parts[1] deals";
}
if ($parts[0]=="merchant")
{
 $header["title"] = "blah blah prices from $parts[1] store";
 $header["meta"]["keywords"] = "blah,buy $parts[1],$parts[1] deals,compare,prices";
 $header["meta"]["description"] = "Great deals from $parts[1] blah blah blah blah great $parts[1] deals";
}

Cheers,
Chris

Submitted by support on Tue, 2010-02-16 09:15

Hi Chris,

Looks fine!

Cheers,
David.

Submitted by kiddaclo on Tue, 2010-02-16 09:43

Thank David.