Keyword

K2 item table: print tags into metakey row

  • RomyS
  • RomyS's Avatar Topic Author
  • Offline
  • Junior Member
More
2 weeks 4 days ago #179026 by RomyS
Hi Fotis and team!

The option to print the Tags as meta keyword in the head is great, but I am trying to achieve that:

IF saving an item $row->metakey is empty  == selected $tags->name are printed inside $row->metakey

This would simplify and help top SEO by being able to send tha tags as keywords in a sitemap or rss.
I know the modification needs to be done in the item's backend model save method, but I only find these lines referring to both fields and I don't know how to combine them.  Please, could you guide me? 


METAKEY > line 140 >
$metadata = JRequest::getVar('meta', null, 'post', 'array');
        if (is_array($metadata)) {
            $txt = array();
            foreach ($metadata as $k => $v) {
                if ($k == 'description') {
                    $row->metadesc = $v;
                } elseif ($k == 'keywords') {
                    $row->metakey = $v;
                } else {
                    $txt[] = "$k=$v";
                }
            }
            $row->metadata = implode("\n", $txt);
        }


TAGS > line 714 >
   $tags = JRequest::getVar('selectedTags', null, 'POST', 'array');
           
Regards

Please Log in or Create an account to join the conversation.

  • Fotis
  • Fotis's Avatar
  • Away
  • Administrator
  • JoomlaWorks Support Team
More
2 weeks 3 hours ago #179050 by Fotis
Replied by Fotis on topic K2 item table: print tags into metakey row
Why duplicate data?

If you use & love K2, please take a moment to add your review and rate it
at the Joomla Extensions Directory: extensions.joomla.org/extension/k2/


IMPORTANT: Please search the forum before posting a question!

JoomlaWorks Support Team Member

Please Log in or Create an account to join the conversation.

  • RomyS
  • RomyS's Avatar Topic Author
  • Offline
  • Junior Member
More
2 weeks 3 hours ago #179055 by RomyS
Replied by RomyS on topic K2 item table: print tags into metakey row
Hi Fotis!
It is not duplicating, since at least in my installation the column "metakey" of the item in the database is empty.

RSS components read the "metakey" in item table to submit keywords in feeds. As the item's "metakey" table is empty, then the RSS does NOT send keywords!

I hope you understand what I propose. Just in case: I use the latest version of K2!

Regards

Please Log in or Create an account to join the conversation.

  • Fotis
  • Fotis's Avatar
  • Away
  • Administrator
  • JoomlaWorks Support Team
More
2 weeks 3 hours ago #179057 by Fotis
Replied by Fotis on topic K2 item table: print tags into metakey row
Well, this is specific to some component for feeds. K2 can output the tags for each item in its feeds (you need to enable that in K2's settings > feeds). Your feed component could simply pick these up instead (if it already has K2-specific integration).

If you use & love K2, please take a moment to add your review and rate it
at the Joomla Extensions Directory: extensions.joomla.org/extension/k2/


IMPORTANT: Please search the forum before posting a question!

JoomlaWorks Support Team Member

Please Log in or Create an account to join the conversation.

  • RomyS
  • RomyS's Avatar Topic Author
  • Offline
  • Junior Member
More
2 weeks 3 hours ago #179058 by RomyS
Replied by RomyS on topic K2 item table: print tags into metakey row
Yes Fotis, I understand. In the case of the k2 feed I use it for the common user, but for example to send news to Google News I use OSMAP PRO and he looks for the "metakey" tab of the database.
That is why it offers you the option of printing them in the database!

Please Log in or Create an account to join the conversation.

  • Fotis
  • Fotis's Avatar
  • Away
  • Administrator
  • JoomlaWorks Support Team
More
2 weeks 3 hours ago #179059 by Fotis
Replied by Fotis on topic K2 item table: print tags into metakey row
Last time I checked, the spec for Google News XML sitemaps does not require (nor accept) any keywords...

support.google.com/news/publisher-center/answer/9606710?hl=en

If you use & love K2, please take a moment to add your review and rate it
at the Joomla Extensions Directory: extensions.joomla.org/extension/k2/


IMPORTANT: Please search the forum before posting a question!

JoomlaWorks Support Team Member

Please Log in or Create an account to join the conversation.

  • Fotis
  • Fotis's Avatar
  • Away
  • Administrator
  • JoomlaWorks Support Team
More
2 weeks 3 hours ago #179060 by Fotis
Replied by Fotis on topic K2 item table: print tags into metakey row
If you're interested in a proper sitemap for Google News though, we have a (yet un-released, but battle-tested) commercial plugin that does exactly that - and it's the lightest it can get. Use our contact page here www.joomlaworks.net/support/get-help/contact if you'd like a copy.

If you use & love K2, please take a moment to add your review and rate it
at the Joomla Extensions Directory: extensions.joomla.org/extension/k2/


IMPORTANT: Please search the forum before posting a question!

JoomlaWorks Support Team Member

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum