Keyword

category k2 item image resize

  • Nickos Dandoulakis
  • Nickos Dandoulakis's Avatar Topic Author
  • Offline
  • New Member
More
8 years 10 months ago #149488 by Nickos Dandoulakis
category k2 item image resize was created by Nickos Dandoulakis
I want to resize all k2 items image in category list with standard heigth and width ... how can i fix it?

Check the issue in upload image imgur.com/wkD7YKk

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
8 years 10 months ago #149535 by Krikor Boghossian
Replied by Krikor Boghossian on topic category k2 item image resize
Only the width is defined in K2's parameters.
You can hardcode a height for the container of the image in your CSS file.

In the category.php file you can add a new element and set a fixed height with overflow: hidden.
<?php if($this->params->get('catImage') && $this->category->image): ?>
<div class="categoryImage">
<!-- Category image -->
	<img alt="<?php echo K2HelperUtilities::cleanHtml($this->category->name); ?>" src="<?php echo $this->category->image; ?>" style="width:<?php echo $this->params->get('catImageWidth'); ?>px; height:auto;" />
</div>
<?php endif; ?>

Remember to use overrides.
More information on overrides can be found here: getk2.org/documentation/tutorials/174-templating-with-k2-and-the-concepts-of-sub-templates

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