Original article in Subcategory image size in K2
First, the size of the subcategory image is determined in the /components/com_k2/css/k2.css file.
In the line of code shown below we can set the width either in pixels or in percentage (basically for “responsive” templates): div.subCategorya.subCategoryImage: hover img {background: #fff; Padding: 4px; Border: 1px solid #ddd; Margin: 0 8px 0 0; width: 98.1%; This in my case has been enough, I usually upload an image with a resolution a little higher than half the maximum width of the site and ready. There are no pixel problems or deterioration of image quality. Maybe it’s because I use values in percent rather than pixels.
However, there are people who indicate they have this problem. The first thing I would recommend is clear the Joomla! Second they can try uploading the image in the required quality manually via FTP. The images can be found in media \ k2 \ categories. Now, it is also possible that you are still taking the image that resized to a lower resolution from the beginning, this is probably in \ media \ k2 \ items \ however resizing the name is changed and can be difficult to find. Anyway it is a complicated process if you have many subcategories. In general, I have seen that the problem may be given (in occasions) by the size assigned in the global parameters to the category image, which initially determines the size of the subcategory, so if we increase the Value in pixels of this, we resubimos the image and we clear cache it can solve the problem.
Finally, this solution is valid for K2 v.2.2, however the idea is the same in any version.
Go to administrator / components / com_k2 / lib / and edit the config.xml file, add this parameter from line 19 (catImageWidth):
<Param name = “hide” name = “subcatImageWidth” type = “text” default = “50” size = “4” label = “subCategory image width
Then navigate to the template you are using and edit the category.php and add the style attribute to SubCategoryImage:
<a href=”/<?php echo $subCategory-> link;?> “>
<Img alt = “<? Php echo $ subCategory-> name;?>” Src = “/ <? Php echo $ subCategory-> image;?>” Style = “width: <? Php echo $ this-> > Get (‘subcatImageWidth’);?> Px; height: auto; ” />
</a>
Save and check.
Always remember to make a backup of the files for any eventuality.
- What are joomla tags and how are the used? - November 3, 2024
- Why and how to create hidden menu items in Joomla? - October 31, 2024
- How to publish smartslider 3 to joomla 4? - October 31, 2024
Recent Comments