- Posts: 14
COMMUNITY FORUM
Category Item image change size
- Nuno Costa
-
Topic Author
- Offline
- New Member
When a new item is published in a category, it will change the size of the images of the items previously published, making them larger.
But it only happens in one column format.
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
-
- Offline
- Platinum Member
- Posts: 15920
This sounds like a template specific solution. Please use the default template to browse these links. If the issue persists, let me know and post a link so I can see the actual issue.
Please Log in or Create an account to join the conversation.
- Nuno Costa
-
Topic Author
- Offline
- New Member
- Posts: 14
First I'm using a default template override, in which the only modification I made was to fix the button style "Redmore" (category_item.php). Therefore, the files from the default directory are virtually unchanged.
Regarding my problem with images, I tried various combinations of one or more columns and image sizes (xlarge, large, medium, small) and none of the default size was recognized, or more correctly the k2 is not applying the default sizes to the images.
I have my website offline. If you want it you can send a password and user to allow access to your site.
Please Log in or Create an account to join the conversation.
- Yiota
-
- Visitor
Please if you could provide us access would be most helpful.
Please Log in or Create an account to join the conversation.
- Nuno Costa
-
Topic Author
- Offline
- New Member
- Posts: 14
I am not able to find the option to send private messages in the forum. How can I send you a private message with the information.
Please Log in or Create an account to join the conversation.
- Yiota
-
- Visitor
Please Log in or Create an account to join the conversation.
- Nuno Costa
-
Topic Author
- Offline
- New Member
- Posts: 14
I have already submitted the information required through contact form
Please Log in or Create an account to join the conversation.
- Yiota
-
- Visitor
body #k2Container.itemListView .itemList #itemListPrimary .catItemImage img
this class has a width:100% !important; if you remove that then your image will be the size you have set up in the K2 parameters of category.
Please Log in or Create an account to join the conversation.
- Nuno Costa
-
Topic Author
- Offline
- New Member
- Posts: 14
I inserted the following code in my template_custom.css file to make the override of thirdpartyk2.css file but is not working.
body #k2Container.itemListView .itemList #itemListPrimary .catItemImage img {
margin: 10px 0 5px 0;
padding: 0;
max-width: 100%;
width: 100%;
border: 1px solid rgba(0,0,0,0.4);
}
I used Chrome to inspect and get the code so I know that removing the !important the override should be working ... can point me what I'm doing wrong.
Please Log in or Create an account to join the conversation.
- Yiota
-
- Visitor
Please Log in or Create an account to join the conversation.
- Nuno Costa
-
Topic Author
- Offline
- New Member
- Posts: 14
Try with width:auto !important;
It worked, but did not solve my problem problem completely.
The image took over the default size but still will not let me change the size.
More precisely, if I change the image size using the category default sizes large, medium, small, and so on, the image takes on the dimensions that are defined in the default parameters... but if I change the dimensions in categories parameters, the new dimensions are not recognized keeping the originals.
Another thing, when I changed to "width: auto !important" the image was centered, but applying "float: left" was fixed.
PS: I also tried using the "inherit !important" but the result was the same.
Please Log in or Create an account to join the conversation.
- Yiota
-
- Visitor
In order for this size to override all others you need to edit the category_item.php file of your template overrides and locate this code
<img src="<?php echo $this->item->image; ?>" alt="<?php if(!empty($this->item->image_caption)) echo K2HelperUtilities::cleanHtml($this->item->image_caption); else echo K2HelperUtilities::cleanHtml($this->item->title); ?>" style="width:<?php echo $this->item->imageWidth; ?>px; height:auto;" />
<img src="<?php echo $this->item->image; ?>" alt="<?php if(!empty($this->item->image_caption)) echo K2HelperUtilities::cleanHtml($this->item->image_caption); else echo K2HelperUtilities::cleanHtml($this->item->title); ?>" style="width:<?php echo $this->item->imageWidth; ?>px !important; height:auto;" />
This will tell your image to always be sized according to the size you provide through the category parameters.
Please Log in or Create an account to join the conversation.
- Nuno Costa
-
Topic Author
- Offline
- New Member
- Posts: 14
I also noticed that this problem with the image default sizes also happened with the item ... I did the same correction in the item.php file and also solved the problem.
thank you! :)
Please Log in or Create an account to join the conversation.
- Yiota
-
- Visitor
Please Log in or Create an account to join the conversation.