Keyword

Add additional meta tags to K2 items

  • chilly_bang
  • chilly_bang's Avatar Topic Author
  • Offline
  • Junior Member
More
11 years 8 months ago #108704 by chilly_bang
Add additional meta tags to K2 items was created by chilly_bang
Hello!

I have many meta tags, which i must add to K2 items. For native Joomla articles i use to use the beautiful JosTag, which adds all what you want to the head. But this nice plugin seems not to work with K2 - i see in the code only the line {tag}meta name="tagname" content="tagcontent"{/tag}, which must run plugin, but there is nothing added to the head of the item:(

I can't attach this plugin to the topic, here is the download link JosTag for all, who interesting.

I need any advice, how to add additional meta tags to K2 item. Or may somebody can adjust the JosTag plugin to let it run with K2 items?

thanks in advance
evgenij

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

More
11 years 8 months ago #108705 by william white
Replied by william white on topic Re: Add additional meta tags to K2 items
Just a guess here,
if your adding the same thing to every item

check with phpmyadmin - there is a field in the k2_item table metadesc
try to echo $this->item->metadesc at the top of your item.php
if it works and returns the proper value
intercept it at the top of item php and put something like this:
$this->item->metadesc = $this->item->metadesc ."what you want to add" ;

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

  • chilly_bang
  • chilly_bang's Avatar Topic Author
  • Offline
  • Junior Member
More
11 years 8 months ago #108706 by chilly_bang
Replied by chilly_bang on topic Re: Add additional meta tags to K2 items
Hello William, and thanks for reply!
So the first part works - i get proper value of echo $this->item->metadesc. But i have difficulty to implementing of your next advice: You mean with this:

intercept it at the top of item php and put something like this:
Log in  or Create an account to join the conversation.

  • chilly_bang
  • chilly_bang's Avatar Topic Author
  • Offline
  • Junior Member
More
11 years 8 months ago - 11 years 8 months ago #108707 by chilly_bang
Replied by chilly_bang on topic Re: Add additional meta tags to K2 items
I got already JosTag plugin working. I added to K2 template this lines
Log in  or Create an account to join the conversation.

More
11 years 8 months ago #108708 by william white
Replied by william white on topic Re: Add additional meta tags to K2 items
nice, you should submit that to the JosTag author to add to their documentation

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

  • chilly_bang
  • chilly_bang's Avatar Topic Author
  • Offline
  • Junior Member
More
11 years 8 months ago #108709 by chilly_bang
Replied by chilly_bang on topic Re: Add additional meta tags to K2 items
This part of work is on the K2 side - i submitted this template hack to K2 tips and tricks here on the official site. I have noticed JosTag developer too, but all, what he can do, is to make a solution a bit more elegant and to let his plugin work with K2 without template hack. There are in JED many plugins, like for example Nice PayPal button, which work with K2 without to ask something, just insert {plugincode} where you want into the code and it works.

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