- Posts: 20
COMMUNITY FORUM
[SOLVED] Hide Empty categoris
- Mohsen Babaei
- Topic Author
- Offline
- Junior Member
Less
More
10 years 9 months ago #122704
by Mohsen Babaei
[SOLVED] Hide Empty categoris was created by Mohsen Babaei
Hello
I want to hide categories that are empty, I mean that I want the subcategories to be shown in category list and k2-tools module just when an item publish in it.
Can any one help me?
thanks
I want to hide categories that are empty, I mean that I want the subcategories to be shown in category list and k2-tools module just when an item publish in it.
Can any one help me?
thanks
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
- Offline
- Platinum Member
Less
More
- Posts: 15920
10 years 9 months ago #122705
by Krikor Boghossian
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Replied by Krikor Boghossian on topic Re: Hide Empty categoris
Unfortunately K2 does not have this setting.
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.
- olsen
- Offline
- Elite Member
- Joomla and K2 Freelancer
10 years 9 months ago #122706
by olsen
Didn't solve your issues?? Why dont you consider hire me? Email me or contact me www.xevedigital.com for details
Replied by olsen on topic Re: Hide Empty categoris
Well, actually it can be done with a template override. Modifying file category.php with an if statement in the subcategory loop to check if the subcategory has items on it.
Something like:
Something like:
<?php if ($subcategory->numofitems > 0) :?>
LOOP
<?php endif ;?>
Didn't solve your issues?? Why dont you consider hire me? Email me or contact me www.xevedigital.com for details
Please Log in or Create an account to join the conversation.
- Mohsen Babaei
- Topic Author
- Offline
- Junior Member
Less
More
- Posts: 20
10 years 8 months ago #122707
by Mohsen Babaei
Thanks
Replied by Mohsen Babaei on topic Re: Hide Empty categoris
Hello and thanks, I copied your code in category.php for Subcategories, then both empty and non-empty categories disappeared. could you tell me where in category.php should be change?olsen wrote: Well, actually it can be done with a template override. Modifying file category.php with an if statement in the subcategory loop to check if the subcategory has items on it.
Something like:
<?php if ($subcategory->numofitems > 0) :?> LOOP <?php endif ;?>
Thanks
Please Log in or Create an account to join the conversation.