CarriedAwayCrafts Posted March 14, 2012 Share Posted March 14, 2012 Greetings, How do I change the image size of the subcategories from the medium (80px × 80px) to something larger and easier to view? Here is what I have tried so far, based on information that I found at other posts on this forum: I created a new picture type called "SubCat" under preferences>Images I Regenerated thumbnails I went to my server and changed the category.tpl file, wherever there was a entry that said 'medium' in association to 'Subcategories,' I changed the value to 'SubCat.' Nothing changed. I even cleared my browser caches and tried on IE, Firefox, and Google Chrome. Still- Nothing changed (so I changed everything back to the original values) Here is the example of the problem and also please note that the text does not wrap properly around the 80px × 80px images (which are just too small): http://www.carriedaw.../5-bath-fizzies It would seem to me that there should be an easy, back office, way of changing the size of these images... but apparently, there is not. Can you help me? Thanks Link to comment Share on other sites More sharing options...
_matis_ Posted March 14, 2012 Share Posted March 14, 2012 Hi, change also controllers/CategoryController.php file on line 133 - here you must add your new picture type: self::$smarty->assign(array( 'products' => (isset($this->cat_products) AND $this->cat_products) ? $this->cat_products : NULL, 'id_category' => (int)($this->category->id), 'id_category_parent' => (int)($this->category->id_parent), 'return_category_name' => Tools::safeOutput($this->category->name), 'path' => Tools::getPath((int)($this->category->id)), 'add_prod_display' => Configuration::get('PS_ATTRIBUTE_CATEGORY_DISPLAY'), 'categorySize' => Image::getSize('category'), 'mediumSize' => Image::getSize('medium'), 'thumbSceneSize' => Image::getSize('thumb_scene'), 'homeSize' => Image::getSize('home'), 'SubCat' => Image::getSize('SubCat') )); Link to comment Share on other sites More sharing options...
CarriedAwayCrafts Posted March 14, 2012 Author Share Posted March 14, 2012 Hello _matis_, Thanks for replying so quickly but I'm sorry to say that that didn't work. When I added 'SubCat' => Image::getSize('SubCat'), as described above, ALL of my categories disappeared- that is to say, when I clicked on the links from my home page, the pages were blank. Link to comment Share on other sites More sharing options...
_matis_ Posted March 14, 2012 Share Posted March 14, 2012 (edited) maybe you forgot add a comma. Correct definition is ... 'homeSize' => Image::getSize('home'), 'SubCatSize' => Image::getSize('SubCat') Edited March 14, 2012 by _matis_ (see edit history) Link to comment Share on other sites More sharing options...
CarriedAwayCrafts Posted March 14, 2012 Author Share Posted March 14, 2012 Thanks, Yes, I did forget the comma (very intuitive of you). However, there is still no change (subcategory images remain 80 x 80 px) Link to comment Share on other sites More sharing options...
_matis_ Posted March 14, 2012 Share Posted March 14, 2012 have you set Force Compile = Yes and Use Cache = No under BO->Preferences->Performance ? Link to comment Share on other sites More sharing options...
CarriedAwayCrafts Posted March 14, 2012 Author Share Posted March 14, 2012 I just did that, and a change ocurred- but not for the better... see for yourself: http://www.carriedawaycrafts.com/5-bath-fizzies Also, I get a warning that says: "To use Memcached, you must install the Memcache PECL extension on your server. http://www.php.net/manual/en/memcache.installation.php" ... not sure what this means). Link to comment Share on other sites More sharing options...
_matis_ Posted March 14, 2012 Share Posted March 14, 2012 now change the sizes also in themes/GreenTheme/css/category.css, line 2: body#category #subcategories li { height: 136px; margin-right: 3px; width: 108px; } Link to comment Share on other sites More sharing options...
CarriedAwayCrafts Posted March 14, 2012 Author Share Posted March 14, 2012 Thanks! That seems to have worked (though I need to fix my actual images). But where did the text go that describes each subcategory?). FOLLOW UP: It seems that I spoke too soon. This is NOT a solution to this problem. For some reason, when I tried to make the SubCat images smaller than the 300x300 pixels (which seemed, momentarily, to be working), my images disappeared and I could not get them back. I am going to try to UNdo all of the changes made and try to repost this problem on one of the other boards as it seems to be more of a 'coding' problem than it does a simple 'configuration' problem. Link to comment Share on other sites More sharing options...
mobilafitness Posted July 30, 2012 Share Posted July 30, 2012 (edited) <div id="subcategories"> <h3>{l s='Subcategories'}</h3> <ul class="list"> {foreach from=$subcategories item=subcategory} <li> <a href="{$link->getCategoryLink($subcategory.id_category, $subcategory.link_rewrite)|escape:'htmlall':'UTF-8'}" title="{$subcategory.name|escape:'htmlall':'UTF-8'}"> {if $subcategory.id_image} <img src="{$link->getCatImageLink($subcategory.link_rewrite, $subcategory.id_image, 'Subcat')}" alt="" width="{$SubcatSize.width}" height="{$SubcatSize.height}" /> {else} <img src="{$img_cat_dir}default-Subcat.jpg" alt="" width="{$SubcatSize.width}" height="{$SubcatSize.height}" /> {/if} </a> <a href="{$link->getCategoryLink($subcategory.id_category, $subcategory.link_rewrite)|escape:'htmlall':'UTF-8'}">{$subcategory.name|escape:'htmlall':'UTF-8'}</a> </li> {/foreach} </ul> Edited July 30, 2012 by mobilafitness (see edit history) Link to comment Share on other sites More sharing options...
mobilafitness Posted July 30, 2012 Share Posted July 30, 2012 worked for me, thanks for help! Link to comment Share on other sites More sharing options...
Housy Posted October 25, 2013 Share Posted October 25, 2013 Have you just changed this part of the code or something else beside that? I'm asking, because it doesn't work for me <div id="subcategories"><h3>{l s='Subcategories'}</h3><ul class="list">{foreach from=$subcategories item=subcategory}<li><a href="{$link->getCategoryLink($subcategory.id_category, $subcategory.link_rewrite)|escape:'htmlall':'UTF-8'}" title="{$subcategory.name|escape:'htmlall':'UTF-8'}">{if $subcategory.id_image}<img src="{$link->getCatImageLink($subcategory.link_rewrite, $subcategory.id_image, 'Subcat')}" alt="" width="{$SubcatSize.width}" height="{$SubcatSize.height}" />{else}<img src="{$img_cat_dir}default-Subcat.jpg" alt="" width="{$SubcatSize.width}" height="{$SubcatSize.height}" />{/if}</a><a href="{$link->getCategoryLink($subcategory.id_category, $subcategory.link_rewrite)|escape:'htmlall':'UTF-8'}">{$subcategory.name|escape:'htmlall':'UTF-8'}</a></li>{/foreach}</ul> Link to comment Share on other sites More sharing options...
dave.pl Posted February 27, 2014 Share Posted February 27, 2014 It's work for me also, many thanks. All what I need is change tpl picture size and change css image size. Many thanks Link to comment Share on other sites More sharing options...
Maikeul Posted March 1, 2014 Share Posted March 1, 2014 Very useful ... It works perfectly for me on 1.5.4.1 version. Special thanks for _matis_ and mobilafitness Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now