Keyword

How to Hide Sub-Categories Blocks that are Empty?

  • marioglez
  • marioglez's Avatar Topic Author
  • Offline
  • New Member
More
13 years 7 months ago #93969 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! 

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

  • marioglez
  • marioglez's Avatar Topic Author
  • Offline
  • New Member
More
13 years 7 months ago #93970 by marioglez
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! :) 

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

  • Yiota
  • Yiota's Avatar
  • Visitor
13 years 7 months ago #93971 by Yiota
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
  • marioglez's Avatar Topic Author
  • Offline
  • New Member
More
13 years 7 months ago #93972 by marioglez
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! :)

 

 

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

More
13 years 4 months 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.

More
13 years 1 week ago #93974 by star R.
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.

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

More
13 years 1 week ago #93975 by star R.
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.


Powered by Kunena Forum