Keyword

K2 Filter items

  • Jozef Pikna
  • Jozef Pikna's Avatar Topic Author
  • Offline
  • New Member
More
10 years 4 months ago #128746 by Jozef Pikna
K2 Filter items was created by Jozef Pikna
Hi !
I have created simply plugin which allows administrator to assign country to K2 Item.
Country is stored in k2_item table (column plugins) in json format.

Is there any way to filter category items by country using events like onK2PrepareContent etc. ?

Thanks for help.

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

More
10 years 4 months ago #128747 by Lefteris
Replied by Lefteris on topic Re: K2 Filter items
Hi. No unfortunately you cannot search by JSON. You will have to modify your plugin to use it's own database so you can add extra queries. A more simple solution would be to use extra fields and use an extension which can filter items based on extra fields.

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

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

  • Jozef Pikna
  • Jozef Pikna's Avatar Topic Author
  • Offline
  • New Member
More
10 years 4 months ago #128748 by Jozef Pikna
Replied by Jozef Pikna on topic Re: K2 Filter items
Thanks for the answer.
I have one more question. Is possible to override or modify method (db query) which retrieves items from database without hacking k2 core files?
Thanks.

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

More
10 years 4 months ago #128749 by Lefteris
Replied by Lefteris on topic Re: K2 Filter items
No currently this is not an easy task. I think it would be more easy to duplicate the K2 view ( or module ) you wish to modify and then modify the code there.

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

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


Powered by Kunena Forum