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?
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?