Display different number of columns for categories

  • Posts: 2
  • Thank you received: 0
10 years 5 months ago #196849

-- HikaShop version -- : v2.4.0
-- Joomla version -- : 3.4.1

I have a rather large set of categories, and sub categories... On a few of the sub category sets, the names of each category are rather long.. I have the overall column count set to 5, but, on some of these, I would like to change it to 4, or maybe even 3. I can't find a way to do this on a per category / subcategory basis without having to make a new menu item for each category.. which is just not practical. Especially since these are 3 or so levels down.

2ndly, Is their a way to display different product layout template files for different set of categories ?

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

  • Posts: 84323
  • Thank you received: 13713
  • MODERATOR
10 years 5 months ago #196875

Hi,

1. There is no option for that. The option is global to the listing menu, and thus, all the categories in it.
A simple solution would be to create a custom field of the table "category" via the menu Display>Custom fields with the column name "columns" where you could enter the number of columns for each category.
Then, add such line of code at the beginning of the file "listing_div" of the view "category" via the menu Display>views:
<?php if(!empty($this->element->columns)) $this->params->set('columns',$this->element->columns); ?>

2. Same as question 1. There is no option, but with a bit of tweaking of the code with a custom category field it's possible.

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

Time to create page: 0.054 seconds
Powered by Kunena Forum