Menu Content

Support

> Forums, FAQs & Paid Support
Welcome, Guest
Username Password: Remember me

How to add keyword meta?
(1 viewing) (1) Guest
Support forum for customers who have purchased paid JoomSEF extension. Archive only, no new post can be added.

NOTE: This category has been locked. If you have purchased paid version, please, use our Support Ticket system instead. If you are using free edition, please see the Community Support section.
  • Page:
  • 1

TOPIC: How to add keyword meta?

How to add keyword meta? 13 years, 2 months ago #23207

Hi, I am using a hacked and rewritten version of Virtuemart extension for my website. I managed to use $this->metadesc and $this->pagetitle to generate meta data and I am looking for something similar for keywords.
Any idea?
I tried $this->metakey but with no results.
Now I just see the automatically generated keywords which I don't like.

Thank you
The topic has been locked.

Re: How to add keyword meta? 13 years, 2 months ago #23218

  • pama
  • OFFLINE
  • Posts: 489
Hi. Variable you're looking for is probably $this->metakeySource.

But note that $this->getMetaTags() function (see source in sef.ext.php) automatically generate meta keys from $this->metakeySource variable (if not set, from $this->metadesc). It's only "source".

If you want to create meta keywords on you own, you must edit directly array produced by that function like that:

 
 
$meta = $this->getMetaTags();
 
$meta['metakey']="your_own_keywords";
 
$newUri = JoomSEF::_sefGetLocation($uri, $title, @$task, @$limit, @$limitstart, @$lang, $this->nonSefVars, $this->ignoreVars, $meta, ...);
 
 
ARTIO Support Team
Last Edit: 13 years, 2 months ago by pama.
The topic has been locked.

Re: How to add keyword meta? 13 years, 2 months ago #23226

Hei, that's great.
I just tried it and it works, but I have a problem with the way it rebuilds the keywords. I'll give you an example:

My keywords are: "carucioare copii, wonderbaby"
When I look on the page they are: "copii, carucioare, wonderbaby"

Can I stop him from doing that?
It also removes 2-3 letters long word, but that's a setting in the admin area.

Thank you
The topic has been locked.

Re: How to add keyword meta? 13 years, 2 months ago #23240

  • pama
  • OFFLINE
  • Posts: 489
Yes. Have you tried that the way in the posted code?

If you pass keywords to $this->metakeySource and then call function $meta = $this->getMetaTags();, it will guess and sanitise keywords from that string and perform sanitation (remove short words, remove words in "blacklist", sort by number of occurencies and strip to defined count (defaultly 8))

On the other hand, if you want to have complete control of generated keywords, store them after calling function $meta = $this->getMetaTags(); directly into $meta['metakey'] variable.
ARTIO Support Team
The topic has been locked.

Re: How to add keyword meta? 13 years, 2 months ago #23243

Hi again,

Because of the way the script is written I cannot use
$meta['metakey']="your_own_keywords";
before
$meta = $this->getMetaTags();
because it would affect the creation of title and description also.
I removed the sanitation completely to solve the problem and I stopped joomsef from generating keywords.
I am now generating my own keywords directly from the Virtuemart extension based on product title, category and website name. (the way amazon.com handles keywords).
Thank you very much for your help and have a nice day.
The topic has been locked.

Re: How to add keyword meta? 13 years, 2 months ago #23244

  • pama
  • OFFLINE
  • Posts: 489
Yes, thats's right. If you call $meta['metakey']="your_own_keywords"; first and then $meta = $this->getMetaTags();, it will simply rewrite $meta['metakey'] by sanitised values.

What i was saying is when you write $meta['metakey']="your_own_keywords"; AFTER $meta = $this->getMetaTags();, it will rewrite "sanitised" meta keywords with your hard-coded ones.

Remember after that pass the $meta variable into the
$newUri = JoomSEF::_sefGetLocation($uri, $title, @$task, @$limit, @$limitstart, @$lang, $this->nonSefVars, $this->ignoreVars, $meta, ...);
ARTIO Support Team
Last Edit: 13 years, 2 months ago by pama.
The topic has been locked.
  • Page:
  • 1
User Login Empty