Setting ItemID of a page based on categoryID of articles
Here is the situation
I am adding some articles within a category that are not linked by a menu item ... when I use JCE to link to these articles from another article, the menu ID of the page displayed is set to the one I am linking from ... This is perfect, the breadcrumbs are working as expected and everything is fine ...
The problem is when I perform a search... when the results return, those linked articles which has no menu item comes back with no itemID
I was wondering if there's a way to modify Joomla Router to set an ItemID for the pages which has no ItemID if they match certain catID ...
I know I will be modifying the core files ... I cannot create hidden menu items because this will disturb the breadcrumbs navigation... The site has huge number of categories so creating menu item for each w开发者_开发知识库ill be painful!
Thanks a lot for your help.
You could certainly modify the router to look up the catID for a particular article, but it would not accomplish anything unless that category has a corresponding menu item. itemID specifically comes from the itemID so there must be a menu item related to it in order for it to be a valid itemID.
You could modify your search form to pass along the current itemID, but if your search shows up on every page, it would vary depending on where the search was initiated.
If all of your content items can use the same itemID, you might want to simply use an override for your search results and add that particular itemID to all your search results.
I am afraid that there is no simple answer if you do not want to create menu items.
精彩评论