Keyword

K2 Subcategory Link / Height Issues

  • conshelf
  • conshelf's Avatar Topic Author
  • Offline
  • New Member
More
2 years 4 months ago #179680 by conshelf
K2 Subcategory Link / Height Issues was created by conshelf
Hello,

I'm trying to add styling to the "View Products" text in the sub categories, looking to make it a button. The issue is, when I do, the button falls outside the category box.

It seems there is javascript handling the height of the box, but that link seems to fall out side the div. 

How can I fix this so I can add some space below the "View Products". Page with the issue is here .

Also, is there a way to control the amount of the subcategory text that gets truncated?

Kind regards,
John

 

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

  • conshelf
  • conshelf's Avatar Topic Author
  • Offline
  • New Member
More
2 years 4 months ago - 2 years 4 months ago #179681 by conshelf
Replied by conshelf on topic K2 Subcategory Link / Height Issues
Hello,

I resolved the truncated text issue I was having, I created a template override and updated the category.php file around line 104 to this: echo K2HelperUtilities::characterLimit($subCategory->description, 120

Would be great to have this as a setting in the "Display Settings" of the category.

Kind regards,
John
Last edit: 2 years 4 months ago by conshelf.

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

  • conshelf
  • conshelf's Avatar Topic Author
  • Offline
  • New Member
More
2 years 4 months ago #179687 by conshelf
Replied by conshelf on topic K2 Subcategory Link / Height Issues
Hello,

I have tried different images heights and different text amounts, but no matter what is done the "View Products" link still falls outside of the main div.

See attachments.

Kind regards,
John

 
Attachments:

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

  • conshelf
  • conshelf's Avatar Topic Author
  • Offline
  • New Member
More
2 years 2 months ago #179808 by conshelf
Replied by conshelf on topic K2 Subcategory Link / Height Issues
Hi there,

I know it's bad forum etiquette to bump a post, but I'm really in need of a solution and it's been over 2 months now.

Any help would be greatly appreciated!

Kind regards,
John

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

  • conshelf
  • conshelf's Avatar Topic Author
  • Offline
  • New Member
More
2 years 1 month ago #179851 by conshelf
Replied by conshelf on topic K2 Subcategory Link / Height Issues
Another observation, this issue does not happen on the ItemList view when viewing the products listed within a sub-category.

Just happens on the subcategory items.

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

  • conshelf
  • conshelf's Avatar Topic Author
  • Offline
  • New Member
More
2 years 1 month ago #179852 by conshelf
Replied by conshelf on topic K2 Subcategory Link / Height Issues
While this is not the ideal solution, since it's modifying a core file. It will be wiped out with each update, so you'll need to manually do this after each update.

The javascript causing this issue is located here:
media/k2/assets/k2.frontend.js

Scroll down to the last block labeled // Equal block heights for the "default" view and comment out the code.

Now you'll be able to use CSS to modify the height of the subcategory. You'll need to add proper CSS media queries for mobile and tablet viewports as well.

Hope this helps someone.

Kind regards,
John

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

More
1 year 11 months ago #179942 by JoomlaWorks
Replied by JoomlaWorks on topic K2 Subcategory Link / Height Issues
My guess is that your Joomla template may be adding some dynamic styling or enforcing block heights which causes the blocks in K2 to extend their parent wrapper.

In any case, a simpler approach overall is to just use K2 template overrides (see this getk2.org/documentation/tutorials/templating-with-k2-and-the-concepts-of-sub-templates) and change the class names (.subCategory & .k2EqualHeights) that the "equal heights" JS function (as referenced here github.com/getk2/k2/blob/master/media/k2/assets/js/k2.frontend.js#L264) uses to equalize the height of the grid.

In the next major update of K2 all this will be replaced by CSS Grid properties either way.

Fotis / 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