Keyword

Need to use category_item.php for custome mysql query

  • Loai Ahmed
  • Loai Ahmed's Avatar Topic Author
  • Offline
  • New Member
More
2 years 11 months ago #178887 by Loai Ahmed
Hi All,
I hope you all are doing well.
I managed to build a mysql select statement to return a set of items in another category rather then the one already rendered, this select statement is located inside the category.php file and it was a simple select * from k2_item_table where another_cat_id= some_value

It returns the needed items ,now, what I need to do is use same category_item.php to render these items returned, so basically the category_item.php needs to be used twice, first for the original items from the main category and the second time needs to be used to render the items I got with my select statement.

Can any one point me in the correct direction of how I can do such thing? highly appreciated.
Regards.

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

  • Loai Ahmed
  • Loai Ahmed's Avatar Topic Author
  • Offline
  • New Member
More
2 years 11 months ago #178897 by Loai Ahmed
Hi again,
I think I need to explain myself more, what I am trying to do is, ...hm..... take this example,

I have category A which lists the industries that a company works in, so when I creat a menu item linking to this category I get to see the list of these items, NOW i am using a php code that creates tabs inside the category.php file, AND i have category B which list the products of each industry of category A

What I like to have is a list of items from category A in the first tab and a list of items from category B in the second tab

I solved the Tab issue and the mysql query to get the list of items from category B, what I am unable to do is pass the query result to category_item.php file to get items from category B to render correctly in second tab to have the look and feel of category A which is listed in the first tab with pagination inside both tabs and every thing?

I just can't figure out how to do this.

I hope some one here can point me to the right direction.

Thank you all.
Regards.

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

More
2 years 11 months ago #178913 by JoomlaWorks
K2 really does all these things by default. Have you explored K2's category options and how you can override things (getk2.org/documentation/tutorials/templating-with-k2-and-the-concepts-of-sub-templates) already?

Fotis / 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