Keyword

Show parentcategory with subcategories in category.php

More
8 years 2 months ago #156079 by Elena
Hello and thank you for help!
I have a problem with display submenu with subcategories.
I need to get object of parent category with list of subcategories this parent category.

For example, in this topic written, how can I get object of parents category - www.joomlaworks.net/forum/k2-en/28957-solved-show-parentcategory-in-category-item-php#102987
But this objects hasn't array of subCategories, like a main category in object $this.

Please, help me to get list of subCategories in object, how I get within this code
$parent = JTable::getInstance('K2Category', 'Table');

Or help me to get full object of K2 category by ID.

Or how can I get list of siblings category to my $this category.

Thank you for help!

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
8 years 2 months ago #156085 by Krikor Boghossian
Replied by Krikor Boghossian on topic Show parentcategory with subcategories in category.php
Hello Elena,

On which view do you want to achieve this, and b) do you have any visual representation?

It can be handled through a lot of ways eg: a menu, db queries etc...

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

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

More
8 years 2 months ago #156095 by Elena
Hello and thank you for answer!

imgur.com/a/fij8f

I have a menu of categories (top block with icons). I made It with use only html, because design did not supported by k2 tools module and I use this part In all pages

Next I have a list of subcategories (H1 and grey blocks next). In first screen It's okay.

And in next screen - I want use list of siblings categories and list of items of this category.


I can't use menu K2 tools, because it's dinamic information into the component K2 ans I have sctructure Main category -> Subcategories.

But can you help me with db queries, how can I get categories by ID?

Thank you so much!

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
8 years 2 months ago #156127 by Krikor Boghossian
Replied by Krikor Boghossian on topic Show parentcategory with subcategories in category.php
Actually there is a much easier solution.
You can create mod_menu overrides and display menus instead of the K2 Tools module.

Mod_Menu supports images, and you can aliases instead of duplicating the menu structure which can harm your URL structure.

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