You are here:  » Meta keywords

Support Forum



Meta keywords

Submitted by blogmaster2003 on Sat, 2010-03-06 22:07 in

I want to use the uploaded keyword tags from the feeds on the product page, how can this be done?

Submitted by support on Mon, 2010-03-08 11:14

Hi,

If you haven't done so already; first add a "keywords" field to your site (so that you can import it. Full details for adding a new field are in the following thread:

http://www.pricetapestry.com/node/3094

With that in place, and the "keywords" field being imported; edit products.php and look for the following code on line 54:

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

...and REPLACE with:

$header["meta"]["keywords"] =
  htmlentities($product["products"][0]["keywords"],ENT_QUOTES,$config_charset);

Hope this helps!

Cheers,
David.

Submitted by blogmaster2003 on Tue, 2010-03-09 01:25

Great that add a new field topic has pased me, i didnt had saw it yet, so this opens a NEW world to this brilliant script.

Thank you for your excelent support, will try it.

Submitted by blogmaster2003 on Tue, 2010-03-09 23:24

Hi

first part is ok.

my main problem now is the header.php

im using a buyed template (revolution) i bought.

<?php if (isset($header["meta"])): foreach($header["meta"] as $name => $content): ?>
<meta name='<?php print $name?>' content='<?php print $content?>' />
<?php endforeach; endif; ?>

can you help me on that too?

Submitted by support on Wed, 2010-03-10 05:53

Hi,

To use your new keywords field as the keywords meta tag, rather than edit html/header.php, make the change in products.php where the meta tags are set (header.php just displays whatever has been set by the main script).

In products.php look for the following code on line 54:

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

...and REPLACE with:

$header["meta"]["keywords"] =
  htmlentities($product["products"][0]["keywords"],ENT_QUOTES,$config_charset);

That should do the trick...

Cheers,
David.

Submitted by blogmaster2003 on Wed, 2010-03-10 19:23

Worked Perfectly

Submitted by Deanh01 on Wed, 2010-04-14 23:48

Hi Dave
Is there a way to do both ways together on the keywords?

Thank You
Dean

Submitted by support on Thu, 2010-04-15 09:20

Hello Dean,

Sure - best way is probably to make the use of keywords field conditional (assuming it is not populated for all products) and then append to the normal version, for example:

$header["meta"]["keywords"] = htmlentities($q,ENT_QUOTES,$config_charset);
if ($product["products"][0]["keywords"])
{
  $header["meta"]["keywords"] .= " ".
    htmlentities($product["products"][0]["keywords"],ENT_QUOTES,$config_charset);
}

Cheers,
David.

Submitted by Deanh01 on Fri, 2010-04-16 10:25

Hi David
When I tried this I got an error. Also I was hoping that I could show both together at the same time if possible.

Thank You
Dean

Submitted by support on Sat, 2010-04-17 08:52

Hello Dean,

You should be able to - what error are you getting? I can't see any syntax errors in the above modification... If you want to email me your modified products.php i'll check it out for you...

Cheers,
David.