Keyword

K2HelperRoute::getItemRoute no ItemId

  • Aimery Marsily
  • Aimery Marsily's Avatar Topic Author
  • Offline
  • Premium Member
More
12 years 5 months ago #65136 by Aimery Marsily
K2HelperRoute::getItemRoute no ItemId was created by Aimery Marsily
Hi all !

I'm building a module for my current project and I'm using K2HelperRoute::getItemRoute for link to the items but I don't know why it's not giving me the right URL, in fact it's the good one but without the ItemId part so it's not good...

I pass as parameter the ID of the Item and the ID of the category where the item is in. Is it something wrong or maybe because it's in subcategories ?

Thanks

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

  • Aimery Marsily
  • Aimery Marsily's Avatar Topic Author
  • Offline
  • Premium Member
More
12 years 4 months ago #65137 by Aimery Marsily
Replied by Aimery Marsily on topic Re: K2HelperRoute::getItemRoute no ItemId
Nobody knows about that ?

I think the problem is about the category ID I pass in argument, it's the children of an other one, if I pass as argument manualy the parent one, the link is ok but if I pass the real one (form children category), it's not the good link...

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

  • Aimery Marsily
  • Aimery Marsily's Avatar Topic Author
  • Offline
  • Premium Member
More
12 years 4 months ago #65138 by Aimery Marsily
Replied by Aimery Marsily on topic Re: K2HelperRoute::getItemRoute no ItemId
So I made some tests and in fact what I call a problem is in fact the normal way K2 getItemRoute works... You can try it with the K2 module_content, the link given on the items are not good. Try with a breadcrumb active and you'll understand it.

So what I see is that to make the getItemRoute works and so find the good itemID you'll have to create all your categories in menu in joomla menu system. Not fun at all !

Maybe the K2 team can fix this and make the _findItem function, find the higher parent of the category pass in argument if there are no menu created for the current one...

It will make the navigation more clean, and the breadcrumb always right.

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


Powered by Kunena Forum