Keyword

K2 menu Itemid and K2 router enhancment

  • Alan Sparkes
  • Alan Sparkes's Avatar Topic Author
  • Offline
  • Premium Member
More
13 years 6 months ago #94656 by Alan Sparkes
K2 menu Itemid and K2 router enhancment was created by Alan Sparkes
Have recently come across an issue using JCE WYSIWYG editor and the K2 advanced links plugin which lets you create links to K2 categories/items in the WYSIWYG editor.

 

If i have a K2 Category 'News' published in a menu  then when I create a link to an individual news item the Advanced Link plugin calls the K2router to work out whether an individual item is published or not. If the router finds the K2 item in the menu system then it addes 'Itemid=[menu item id]' to the link available. If not then it doesn't add the menu reference.

 

Whats wrong with this?

Well it means that by default when a K2 item is viewed on the front end that is not published in the menu system, it is automatically given the same Itemid as the page its one. The resulting effect is that you could be in a section of a site 'About us' and link to a news item in 'News' but the page will only render in the context of 'About us' because it keeps this id.

Suggestion for comment

Does it make sense to do an additional route check for parent categories?

Eg id K2 item id =2 is not published in the menu system should the router then go and check for the category and assign that Itemid, and then recursively check parent categories too?

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


Powered by Kunena Forum