Keyword

Using K2 fields as metadata in Head

More
11 years 6 months ago #110947 by Greg
Hi again,

Second post in 24hrs!

What I've been trying to do is use K2's fields (title, tags, image, etc.) to create extra metadata fields.

I did originally put the new tags in item.php which worked perfectly... apart from it didn't put them in the <head> tag on the page.

Now I've solved that by putting them into the head section of the template this means that I cannot call K2 fields in this way.
Log in  or Create an account to join the conversation.

More
11 years 6 months ago #110948 by Greg
Replied by Greg on topic Re: Using K2 fields as metadata in Head
To add. I think this might need to be done by a php include of the instructions K2 uses to define where the fields are in the database.

Firstly I'm not sure where the instructions are (/www/components/com_k2/helpers possibly?)

Secondly I'm not sure how to include this info in the head tag. I'm very new to php

I think it might be something like include_once ('/K2 INSTRUCTIONS FILE.php')

Will post if I get further

G

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

More
11 years 6 months ago #110949 by Greg
Replied by Greg on topic Re: Using K2 fields as metadata in Head
Although I do appear to be having a conversation with myself. I'm getting there.

I've worked out the php include code but not the file that the information on the fields I'm looking for is from

<?php include $_SERVER . "/modules/mod_k2_content/helper.php" ?>


Any thoughts on what file it is? I thought helper was logical but it appears to not be.

G

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

  • Mohamed Abdelaziz
  • Mohamed Abdelaziz's Avatar
  • Offline
  • Platinum Member
  • Joomla Developer
More
11 years 6 months ago #110950 by Mohamed Abdelaziz
Replied by Mohamed Abdelaziz on topic Re: Using K2 fields as metadata in Head
I have developed the plugin AutoMeta for K2 to implement this requirement and more...

With this plugin, you can use extra fields, item tags, item title, category name in meta keywords and description.

Multiple Extra Fields Groups for K2
AutoMeta for K2
Chained Fields for K2
More K2 Extensions In My Extensions Store

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

More
11 years 6 months ago #110951 by william white
Replied by william white on topic Re: Using K2 fields as metadata in Head
@Mohamed Very nice - keep them coming

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

  • Mohamed Abdelaziz
  • Mohamed Abdelaziz's Avatar
  • Offline
  • Platinum Member
  • Joomla Developer
More
11 years 6 months ago #110952 by Mohamed Abdelaziz
Replied by Mohamed Abdelaziz on topic Re: Using K2 fields as metadata in Head
Thanks William

Multiple Extra Fields Groups for K2
AutoMeta for K2
Chained Fields for K2
More K2 Extensions In My Extensions Store

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

More
11 years 6 months ago #110953 by Greg
Replied by Greg on topic Re: Using K2 fields as metadata in Head
Mohamed that is awesome (I've already persuaded a client they need it)!

I think an auto K2 meta for Joomla 3 was very much needed.

However I'm looking also to add microdata info. In addition to what your plugin does.

I've already created a Link to Google+ in the Author info which I can hopefully call if I know where the 'instruction' file is in K2. This way the template can pull the info from K2.

Any help would be appreciated

(And +1 again to Mohamed)

Thanks
Greg

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

  • Mohamed Abdelaziz
  • Mohamed Abdelaziz's Avatar
  • Offline
  • Platinum Member
  • Joomla Developer
More
11 years 6 months ago #110954 by Mohamed Abdelaziz
Replied by Mohamed Abdelaziz on topic Re: Using K2 fields as metadata in Head
Hello Greg,

Thanks for this support :)

Can you explain what you need in more details?

I'm open to all suggestions and additions if this will help K2 community.

Multiple Extra Fields Groups for K2
AutoMeta for K2
Chained Fields for K2
More K2 Extensions In My Extensions Store

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

More
11 years 6 months ago #110955 by Greg
Replied by Greg on topic Re: Using K2 fields as metadata in Head
Hi Mohamed,

Sorry for the late reply. I'm looking to use k2 author info to add microdata to pull K2 author and place it as microdata. I'm comfortable with the schema.org system

BUT I'm struggling to get to pull the relevant K2 info.

I added this to the head but it's not the correct way to pull the K2 data from the sql db.
Log in  or Create an account to join the conversation.

More
11 years 6 months ago #110956 by Greg
Replied by Greg on topic Re: Using K2 fields as metadata in Head
If anyone can suggest why the following code isn't working that would be muchly appreciated.

Once I've got this working I can implement the rich snippets info from K2 profile, etc.
Log in  or Create an account to join the conversation.