- Posts: 16
COMMUNITY FORUM
How to Hide Sub-Categories Blocks that are Empty?
- marioglez
-
Topic Author
- Offline
- New Member
Less
More
14 years 3 months ago #93969
by marioglez
How to Hide Sub-Categories Blocks that are Empty? was created by marioglez
When clicking on a joomla menu item that points to a k2 parent category view (which contain multiple sub-categories), is there way for the "sub-categories blocks" that are empty (with 0 items) to NOT to be displayed at all?
I ask this, because when folks want to get started with k2 to build (member-driven) directory type of websites with a ton of initial sub-categories, it would be usable/ideal/nice for empty sub-categories blocks not to show up until they actually have (at least 1) content items from the member submissions.
Any direction will be highly appreciated!
I ask this, because when folks want to get started with k2 to build (member-driven) directory type of websites with a ton of initial sub-categories, it would be usable/ideal/nice for empty sub-categories blocks not to show up until they actually have (at least 1) content items from the member submissions.
Any direction will be highly appreciated!
Please Log in or Create an account to join the conversation.
- marioglez
-
Topic Author
- Offline
- New Member
Less
More
- Posts: 16
14 years 3 months ago #93970
by marioglez
Replied by marioglez on topic How to Hide Sub-Categories Blocks that are Empty?
I am gonna have to hack the core k2? :(
Either way, k2 rocks! But if any of you have any pointers i would make sure that is a mutually win/win for the two of us! :)
Either way, k2 rocks! But if any of you have any pointers i would make sure that is a mutually win/win for the two of us! :)
Please Log in or Create an account to join the conversation.
- Yiota
-
- Visitor
14 years 3 months ago #93971
by Yiota
Replied by Yiota on topic How to Hide Sub-Categories Blocks that are Empty?
You just need to make an if statement right above the div block of the subcategories in your template override category.php file. Definitely NOT in the K2 core files.
Please Log in or Create an account to join the conversation.
- marioglez
-
Topic Author
- Offline
- New Member
Less
More
- Posts: 16
14 years 3 months ago #93972
by marioglez
Replied by marioglez on topic How to Hide Sub-Categories Blocks that are Empty?
Thank you Yiota, that was the answer I was looking for. I will learn all about the k2 template overrides.
The K2 Community at work! :)
The K2 Community at work! :)
Please Log in or Create an account to join the conversation.
- Giorgio Carrozzini
-
- Offline
- New Member
Less
More
- Posts: 1
14 years 1 week ago #93973
by Giorgio Carrozzini
Replied by Giorgio Carrozzini on topic How to Hide Sub-Categories Blocks that are Empty?
Here you are the category.php file hacked that do this... problem solved...
Please Log in or Create an account to join the conversation.
- star R.
-
- Offline
- New Member
Less
More
- Posts: 6
13 years 7 months ago #93974
by star R.
Replied by star R. on topic How to Hide Sub-Categories Blocks that are Empty?
Perhaps you can simply paste the code here? I just want to make the change in my own category.php file, not replace the whole thing.
Thanks.
Thanks.
Please Log in or Create an account to join the conversation.
- star R.
-
- Offline
- New Member
Less
More
- Posts: 6
13 years 7 months ago #93975
by star R.
Replied by star R. on topic How to Hide Sub-Categories Blocks that are Empty?
I uploaded this file in place of components/com_k2/templates/default/category.php and nothing changed. Empty subcategories are still being shown.
Please Log in or Create an account to join the conversation.