Keyword

"Menu Item" metadata overwrites K2 metadata

More
10 years 11 months ago #119025 by xeont
Hi

I'm linking K2 as Categories in the Menu Item.

K2 » Categories

Menu Item metadata overwrite all K2 meta data.

Menu Item meta Description will be on every K2 Categories and Items meta Description.

Same for the Keywords and Browser Title (Except for K2 Item Title change per Item)

Am i missing something or is this a Bug?

Any help?

Tried with freshly installed Joomla 3.1.1 and K2 2.6.7 still get the same result.

Current - Joomla 3.1.1 | K2 2.6.6 (Tried 2.6.7 but no luck)

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

  • Mohamed Abdelaziz
  • Mohamed Abdelaziz's Avatar
  • Offline
  • Platinum Member
  • Joomla Developer
More
10 years 11 months ago #119026 by Mohamed Abdelaziz
Replied by Mohamed Abdelaziz on topic Re: "Menu Item" metadata overwrites K2 metadata
I think this is the expected behaviour from fast code inspection, I will give it another deep look and get back to you.

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
10 years 11 months ago - 10 years 11 months ago #119027 by xeont
Thank you very much!

Got a reply from Lefteris Kavadas,

"Hi. The menu always override the metadata. That's why those options are there. You can leave them blank in the menu settings or create menu link for single categories also instead of having one menu link for all."

I'm linking two categories, it will be so nice to have separate meta data and title for Menu Item and K2 Categories and K2 Items.

I came up with a idea, please check if it would work;

I'm trying to run the piece of code which fetch the meta data and title from Menu Item only one with condition like,
Log in  or Create an account to join the conversation.

More
10 years 11 months ago #119028 by xeont
No Luck..

works only for the first time.

if you click menu item again, meta data is missing

shouldn't be using a session anyway. Google doesn't recommending it.

there must be a better solution. which i don't know

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
10 years 11 months ago #119029 by Krikor Boghossian
Replied by Krikor Boghossian on topic Re: "Menu Item" metadata overwrites K2 metadata
Hello xeont,

I am still not sure what you want to accomplish with this code snippet. If you are having menu item setting these will override the K2 category settings. So you can either create one menu per category or use Joomla!'s API docs.joomla.org/JDocument/setMetaData for a more custom solution. I would however recommend having one category per menu item.

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

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

More
10 years 11 months ago #119030 by xeont
:P

I didddddd itttttt!!!!!!

After hours of trying, trying and trying finally i can have separate Meta Data for everything with Multiple Categories linking to one Menu Item.

it wasn't hard it as i thought.

What i did was

first fetch the Metadata from Menu Item and set the Metadata for the Menu Item.

Then i inserted the code for fetching Metadata from categories into category "case" function and set the Metadata for categories!

Now working like a charm!

When you click the Menu Item > It set the metadata for Menu Item because it NOT a Case=!Categories

When you click categories > It set the Metadata for Category because NOW Case=Categories

Admins you could have told me this before :P

Just changing the places of code, this could be easily done

Please correct me if i'm wrong!

I'll post the code here

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