Keyword

Fixed width for items in Catalog view?

  • Paul Le Fevre
  • Paul Le Fevre's Avatar Topic Author
  • Offline
  • New Member
More
11 years 11 months ago #105305 by Paul Le Fevre
Fixed width for items in Catalog view? was created by Paul Le Fevre
Hi there, I have noticed that whenever I have just 1 item in a category and I am viewing that category, the single item takes up the full width instead of just occupying the first column (I have set the no. of columns in the "Sub-category" handling section to "3". I want items displayed in a category view to conform to the 3 columns I have set so that if there is 1 item, it simply takes up the first column, not all 3.

The category with a single item in it is here:
www.fly.com.au/australmold/index.php/products/itemlist/category/14

Another category with 2 items in it is here:
www.fly.com.au/australmold/index.php/products/itemlist/category/10

Given the behaviour of the single item category, I expected the category with 2 items to split the available width 50/50 but it didn't, it displayed them taking up columns 1 and 2 just like I wanted. I just can't figure out the problem with single items.

PS is there somewhere that explains the "Leading, Primary, Secondary and Links settings in the Layout Grid section of Category Item Layout? I want to be able to control the size of images used in the child categories but nothing I do seems to change them. I must be looking in the wrong place.

Thanks in advance.

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

More
11 years 9 months ago #105306 by Alex
Same problem here!

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

More
11 years 9 months ago #105307 by Peter Grube
Replied by Peter Grube on topic Re: Fixed width for items in Catalog view?
Do you have link to page in question ? .

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

More
11 years 9 months ago - 11 years 9 months ago #105308 by Alex
No i do not have. I am working localy. I came with a solution though. I found out that when there is only one item left the itemContainer div does not get any width. Therefore i went into category.php whether it is under components/com_k2/templates/default folder or under templates/yourtemplate/html/com_k2/templates/yoursubtemplate folder and commented out (count($this->leading)==1) ? ' ' : from the following lines of code:

at line 151
<div class="itemContainer<?php echo $lastContainer; ?>"<?php echo /*(count($this->leading)==1) ? ' ' :*/' style="width:'.number_format(100/$this->params->get('num_leading_columns'), 1).'%;"'; ?>>

at line 179
<div class="itemContainer<?php echo $lastContainer; ?>"<?php echo /*(count($this->leading)==1) ? '' :*/ ' style="width:'.number_format(100/$this->params->get('num_primary_columns'), 1).'%;"'; ?>>

at line 207
<div class="itemContainer<?php echo $lastContainer; ?>"<?php echo /*(count($this->secondary)==1) ? '' :*/ ' style="width:'.number_format(100/$this->params->get('num_secondary_columns'), 1).'%;"'; ?>>

and at line 236
<div class="itemContainer<?php echo $lastContainer; ?>"<?php echo /*(count($this->links)==1) ? '' : */' style="width:'.number_format(100/$this->params->get('num_links_columns'), 1).'%;"'; ?>>

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


Powered by Kunena Forum