- Posts: 38
COMMUNITY FORUM
Column Fix for Subcategories
- strummsteel
-
Topic Author
- Offline
- Junior Member
Less
More
14 years 7 months ago #89014
by strummsteel
Column Fix for Subcategories was created by strummsteel
K2 has a bug in not rendering column properly in Sub Categories. If only one subcategory is created it wont flush to the full width of the page.
edit this (line 220)
<div class="subCategoryContainer<?php echo $lastContainer; ?>"<?php echo (count($this->subCategories)==1) ? '' : ' style="width:'.number_format(100/$this->params->get('subCatColumns'), 1).'%;"'; ?>>
replace with this (line 220)
<div class="subCategoryContainer<?php echo $lastContainer; ?>"<?php echo ' style="width:'.number_format(100/$this->params->get('subCatColumns'), 1).'%;"'; ?>>
Subcategory columns now work properly
edit this (line 220)
<div class="subCategoryContainer<?php echo $lastContainer; ?>"<?php echo (count($this->subCategories)==1) ? '' : ' style="width:'.number_format(100/$this->params->get('subCatColumns'), 1).'%;"'; ?>>
replace with this (line 220)
<div class="subCategoryContainer<?php echo $lastContainer; ?>"<?php echo ' style="width:'.number_format(100/$this->params->get('subCatColumns'), 1).'%;"'; ?>>
Subcategory columns now work properly
Please Log in or Create an account to join the conversation.
- Arnold Thompson
-
- Offline
- New Member
Less
More
- Posts: 9
14 years 7 months ago #89015
by Arnold Thompson
Replied by Arnold Thompson on topic Column Fix for Subcategories
WoW! Great detective work and may the K2 fix become permanent. Hear that K2? Update the next release please.
Please Log in or Create an account to join the conversation.
- Jennifer
-
- Offline
- New Member
Less
More
- Posts: 7
14 years 7 months ago #89016
by Jennifer
Replied by Jennifer on topic Column Fix for Subcategories
Hello! Now, with the above code, you are talking about using this in the k2.css ?
This is all a struggle for me to learn, and am tempted as a newbie to just give up on K2. I think K2 is a great product with great potential, but maybe not for noobs and not out of the box for sure.
Thanks, Jennifer
This is all a struggle for me to learn, and am tempted as a newbie to just give up on K2. I think K2 is a great product with great potential, but maybe not for noobs and not out of the box for sure.
Thanks, Jennifer
Please Log in or Create an account to join the conversation.
- Arnold Thompson
-
- Offline
- New Member
Less
More
- Posts: 9
14 years 7 months ago #89017
by Arnold Thompson
Replied by Arnold Thompson on topic Column Fix for Subcategories
This small added code snippet is now in K2 version 2.4.1 in the \components\comK2\templates\default\category.php file at line 89.
The added code snippet in the new code was:
echo (count($this->subCategories)==1) ? '' : '
The added code snippet in the new code was:
echo (count($this->subCategories)==1) ? '' : '
Please Log in or Create an account to join the conversation.
- Jennifer
-
- Offline
- New Member
Less
More
- Posts: 7
14 years 7 months ago #89018
by Jennifer
Replied by Jennifer on topic Column Fix for Subcategories
Thanks, Arnold! I did update to 2.4.1 so won't mess with that! I appreciate your help.
Arnold Thompson said:This small added code snippet is now in K2 version 2.4.1 in the \components\comK2\templates\default\category.php file at line 89.The added code snippet in the new code was:echo (count($this->subCategories)==1) ? '' : '
Arnold Thompson said:This small added code snippet is now in K2 version 2.4.1 in the \components\comK2\templates\default\category.php file at line 89.The added code snippet in the new code was:echo (count($this->subCategories)==1) ? '' : '
Please Log in or Create an account to join the conversation.
- strummsteel
-
Topic Author
- Offline
- Junior Member
Less
More
- Posts: 38
14 years 7 months ago #89019
by strummsteel
Replied by strummsteel on topic Column Fix for Subcategories
Hey sorry I forgot to update you i was working on my custom category.php sorry hence the wrong line code.
Line 89 is the right line.
Can anyone confirm the code was fixed in 2.4.1?
I still had to input my code fix to get it right, even from the default category.php
The width 100% code doesn't apply to single subcategories only on two or more.
Line 89 is the right line.
Can anyone confirm the code was fixed in 2.4.1?
I still had to input my code fix to get it right, even from the default category.php
The width 100% code doesn't apply to single subcategories only on two or more.
Please Log in or Create an account to join the conversation.