MerchantName Page - Extra Description For Meta Tag
Hi David,
How difficult is to add an additional description to the meta name='description' of pages generated when clicking on the merchant name link?
Right now it just show "meta name='description' content='MerchantName product index'"
I would like to show more than: 'MerchantName product index' for every merchant page result.
I read that for the product pages we can make a directory of MerchantName extra descriptions, but I don't know how to call those descriptions for the MerchantName product index pages.
Thanks.
Thanks David, that was fast!
I played around with the code, and I like what I see, and can do now.
One final question, how can I move the $header["meta"]["keywords"] to show below the $header["meta"]["description"] ?
I tried to swap the meta code but, I got an unexpected 'case' syntax error, and I don't want to mess up the new code.
Thanks.
Hi,
Make sure it's outside the switch() construct - have a go with:
if($parts[1])
{
switch($parts[0])
{
case "merchant":
$merchantinfoFilename = "merchantinfo/".$parts[1].".html";
if (file_exists($merchantinfoFilename))
{
$header["meta"]["description"] = file_get_contents($merchantinfoFilename);
break;
}
default:
$header["meta"]["description"] = $parts[1]." product index";
break;
}
if ($page > 1) $header["meta"]["description"] .= " page ".$page;
$header["meta"]["keywords"] = $parts[1];
}
Cheers,
David.
--
PriceTapestry.com
Hi Capricorn,
It looks like you have this modification in place, so together with a merchantinfo/ folder containing descriptions for each merchant (as per this thread), then you could do this with an alternative replacement as follows (leaving the CategoryName Product Index and BrandName Product Index descriptions in place - although the same method can be applied to these also)....
if($parts[1])
{
$header["meta"]["keywords"] = $parts[1];
switch($parts[0])
{
case "merchant":
$merchantinfoFilename = "merchantinfo/".$parts[1].".html";
if (file_exists($merchantinfoFilename))
{
$header["meta"]["description"] = file_get_contents($merchantinfoFilename);
break;
}
default:
$header["meta"]["description"] = $parts[1]." product index";
break;
}
if ($page > 1) $header["meta"]["description"] .= " page ".$page;
}
Hope this helps!
Cheers,
David.
--
PriceTapestry.com