Keyword

K2 Hide Empty Subcategories, Control Category Page Layout, Hide Subcategory titles on Category page

  • star R.
  • star R.'s Avatar Topic Author
  • Offline
  • New Member
More
13 years 1 week ago #100111 by star R.
A few questions about setting up K2 categories. Use the main category "News" as an example. This category has say, 6 subcategories. All subcategories do NOT yet have content.

 

#1 - How to ultimately control a category page's layout?  Does this happen


In the actual category parameters i.e. K2 > Categories > Category > parameters OR
In the Menu Link K2 parameters i.e. Main Menu > News > Change Type > K2 > Latest News > (menu item parameters)

#2 - How to hide subcategories that do not yet have content. e.g. Clicking the main category "News" should take the viewer to a page listing all latest news items, excluding any subcategories without content. Right now, there are big white blocks where subcategories have no updates (SEE ATTACHED IMAGE)

 

#3 - When in the main category page, how can we hide the sub-category titles completely and simply list all News subcategories seamlessly? We do not want any extra white space.

 

Thanks.
Attachments:

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

More
13 years 1 week ago #100112 by william white
2. in category.php on line 134 k2 2.5 this is used to test for items in a category

<?php if((isset($this->leading) || isset($this->primary) || isset($this->secondary) || isset($this->links)) && (count($this->leading) || count($this->primary) || count($this->secondary) || count($this->links))): ?>


to check if there are any items to display

I would try to add up the values of count and test the result for >0

Place this code above in an override

The layout is controlled first by the params and then by the override

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


Powered by Kunena Forum