Keyword

How to justify columns in K2 category listing view

  • Nikola Krasojevic
  • Nikola Krasojevic's Avatar Topic Author
  • Offline
  • New Member
More
8 years 3 months ago #155307 by Nikola Krasojevic
How to justify columns in K2 category listing view was created by Nikola Krasojevic
I spent few days with this problem, and didn't solve it. I got page on website I create where I want to show items from K2 categories. It consists of images only, something like gallery. Items are shown in 4 columns. The first column stick to the left edge of container, but the last column don't do that. There is gap between it and right edge, like in picture shown.

imgur.com/ael0Ks4

How can I justify columns to lean on edges of container? Tried with css justify content space-between and it doesn't work.

Tnx to all :)

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
8 years 3 months ago #155437 by Krikor Boghossian
Replied by Krikor Boghossian on topic How to justify columns in K2 category listing view
Hello Nikola,

Since this is a visual issue a link is needed in order to troubleshoot the issue.

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

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

  • Nikola Krasojevic
  • Nikola Krasojevic's Avatar Topic Author
  • Offline
  • New Member
More
8 years 3 months ago #155495 by Nikola Krasojevic
Replied by Nikola Krasojevic on topic How to justify columns in K2 category listing view
Tnx for your answer. Link for my testing page is studiomob.rs/index.php/about-us I will send you user and pass for access in private because web site is offline.

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

  • Nikola Krasojevic
  • Nikola Krasojevic's Avatar Topic Author
  • Offline
  • New Member
More
8 years 3 months ago #155496 by Nikola Krasojevic
Replied by Nikola Krasojevic on topic How to justify columns in K2 category listing view
I created user Harald with pass sara.9646. You can access it now

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

  • Nikola Krasojevic
  • Nikola Krasojevic's Avatar Topic Author
  • Offline
  • New Member
More
8 years 3 months ago #155506 by Nikola Krasojevic
Replied by Nikola Krasojevic on topic How to justify columns in K2 category listing view
Made some changes, but problem still there. Problematic page is now at home page studiomob.rs

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
8 years 3 months ago #155517 by Krikor Boghossian
Replied by Krikor Boghossian on topic How to justify columns in K2 category listing view
You will need to stretch the image from end to end, apply a negative margin to the outer container and apply some padding to the .itemContainer class.

You can find a demo here: gist.github.com/kricore/0425080d36321d3be94e566ac662d97e

Make sure to use overrides, so you won't lose your edits when you update.

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

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

  • Nikola Krasojevic
  • Nikola Krasojevic's Avatar Topic Author
  • Offline
  • New Member
More
8 years 3 months ago #155555 by Nikola Krasojevic
Replied by Nikola Krasojevic on topic How to justify columns in K2 category listing view
Thank you a lot :)
Somehow I did it in a different way. I reduced Item Container width to 23.5% which is exactly size of immage, add some right margins, and cleared right margin for ItemContainerLast.

But now I have some very strange problem. I got 4 categories. All shows all 4 categories, Retail only Items from retail category, and so one. Very strange behaviour I got with Branding category which show 3 items in that category. The problem is that all 3 items are shown like itemContainerLast and because of that they all got margins from div.ItemContainerLast. How is that happening

It is on page studiomob.rs/index.php/work/branding

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

  • Nikola Krasojevic
  • Nikola Krasojevic's Avatar Topic Author
  • Offline
  • New Member
More
8 years 3 months ago #155556 by Nikola Krasojevic
Replied by Nikola Krasojevic on topic How to justify columns in K2 category listing view
SOLVED, found this on one forum and it works :)

I solved it by replacing, in category.php, this:
<?php
if( (($key+1)%($this->params->get('num_leading_columns'))==0) || count($this->leading)<$this->params->get('num_leading_columns') )
$lastContainer= ' itemContainerLast';
else
$lastContainer='';
?>
with this:
<?php
if( (($key+1)%($this->params->get('num_leading_columns'))==0) )
$lastContainer= ' itemContainerLast';
else
$lastContainer='';
?>
regards :)

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
8 years 3 months ago #155572 by Krikor Boghossian
Replied by Krikor Boghossian on topic How to justify columns in K2 category listing view
Nice to hear that the issue has been solved :)

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

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


Powered by Kunena Forum