- Posts: 2
COMMUNITY FORUM
- Forum
- K2 Community Forum
- English K2 Community
- Show parentcategory with subcategories in category.php
Show parentcategory with subcategories in category.php
- Elena
-
Topic Author
- Offline
- New Member
Less
More
8 years 10 months ago #156079
by Elena
Show parentcategory with subcategories in category.php was created 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
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!
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
-
- Offline
- Platinum Member
Less
More
- Posts: 15920
8 years 10 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...
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...
Please Log in or Create an account to join the conversation.
- Elena
-
Topic Author
- Offline
- New Member
Less
More
- Posts: 2
8 years 10 months ago #156095
by Elena
Replied by Elena on topic Show parentcategory with subcategories in category.php
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!
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
-
- Offline
- Platinum Member
Less
More
- Posts: 15920
8 years 10 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.
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.
Please Log in or Create an account to join the conversation.
- Forum
- K2 Community Forum
- English K2 Community
- Show parentcategory with subcategories in category.php