Runge1980 Posted March 9, 2014 Share Posted March 9, 2014 Hi there people. Have a little problem. I had some problems making the pictures in subcategories show right. Was as they where not scaling right. I got the advice to scale the picture, and change the medium default settings under "pictures" in BO. The right scale was 58 x 200px. And this seemed to fix the problem. (See pic 2 and 3) But...then i noticed it had messed up the thumblist under the product pic. (See Pic 1) Any ides.... Hope so... Regards. Lasse Link to comment Share on other sites More sharing options...
vekia Posted March 10, 2014 Share Posted March 10, 2014 you have to create separate image for your categories. go to preferences > images and create new category image, for exaple newCatImage and assign it only to categories. put back settings for medium_default to original (58x58) after that regenerate thumbnails. now go to category.tpl file and change medium_default imagetype to your new image, just use newCatImage instead of medium_default voila Link to comment Share on other sites More sharing options...
Runge1980 Posted March 10, 2014 Author Share Posted March 10, 2014 Hi Vekia. Tried it. worked fine on the tunbnails. But it messed up the subcategory images, and turned them back to 58x58 px <a href="{$link->getCategoryLink($subcategory.id_category, $subcategory.link_rewrite)|escape:'htmlall':'UTF-8'}" title="{$subcategory.name|escape:'htmlall':'UTF-8'}" class="img"> {if $subcategory.id_image} <img src="{$link->getCatImageLink($subcategory.link_rewrite, $subcategory.id_image, 'Newcatimage')}" alt="" width="{$mediumSize.width}" height="{$mediumSize.height}" /> {else} <img src="{$img_cat_dir}default-medium_default.jpg" alt="" width="{$mediumSize.width}" height="{$mediumSize.height}" /> {/if} </a> <a href="{$link->getCategoryLink($subcategory.id_category, $subcategory.link_rewrite)|escape:'htmlall':'UTF-8'}" class="cat_name">{$subcategory.name|escape:'htmlall':'UTF-8'}</a> {if $subcategory.description} <p class="cat_desc">{$subcategory.description}</p> {/if} Link to comment Share on other sites More sharing options...
vekia Posted March 10, 2014 Share Posted March 10, 2014 if you right click on subcategory image (on category page) you see new imagetype in picture path ? Link to comment Share on other sites More sharing options...
Runge1980 Posted March 10, 2014 Author Share Posted March 10, 2014 Yes. it says <img src="http://techstore.dk/c/12-Newcatimage/iphone.jpg" alt="" width="58" height="58"> I made the following preferences > images and createed new category image called Newcatimage. Set the pixels to: 201px width and 58px height Link to comment Share on other sites More sharing options...
dioniz Posted March 10, 2014 Share Posted March 10, 2014 have you changed the code in category.tpl? {if $subcategory.id_image} <img src="{$link->getCatImageLink($subcategory.link_rewrite, $subcategory.id_image, 'medium_default')|escape:'html'}" alt="" width="{$mediumSize.width}" height="{$mediumSize.height}" /> {else} <img src="{$img_cat_dir}default-medium_default.jpg" alt="" width="{$mediumSize.width}" height="{$mediumSize.height}" /> {/if} Change medium_default to your new image size name Link to comment Share on other sites More sharing options...
Runge1980 Posted March 10, 2014 Author Share Posted March 10, 2014 Hi Dioniz. Think i have only changed it one place in the Category.tpl Here is what mine looks like: {if $subcategory.id_image} <img src="{$link->getCatImageLink($subcategory.link_rewrite, $subcategory.id_image, 'Newcatimage')}" alt="" width="{$mediumSize.width}" height="{$mediumSize.height}" /> {else} <img src="{$img_cat_dir}default-medium_default.jpg" alt="" width="{$mediumSize.width}" height="{$mediumSize.height}" /> Link to comment Share on other sites More sharing options...
dioniz Posted March 10, 2014 Share Posted March 10, 2014 can you try to delete width="{$mediumSize.width}" height="{$mediumSize.height}" and see if it works Link to comment Share on other sites More sharing options...
vekia Posted March 10, 2014 Share Posted March 10, 2014 it's because of controller there is a code like: 'mediumSize' => Image::getSize(ImageType::getFormatedName('medium')), (controllers/front/CategoryController.php) you have to change controller, or include height and width param instead of variable {mediumSize} Link to comment Share on other sites More sharing options...
Runge1980 Posted March 10, 2014 Author Share Posted March 10, 2014 Hi found the mediumSize' => Image::getSize(ImageType::getFormatedName('medium')), So do I change the ('medium')), to pixels size of the picture that is = 201x58px Link to comment Share on other sites More sharing options...
vekia Posted March 10, 2014 Share Posted March 10, 2014 if you want to modify controller use your new imagetype name instead of "medium" if you don't want to modify controllers - change .tpl file instead of <img src="{$link->getCatImageLink($subcategory.link_rewrite, $subcategory.id_image, 'Newcatimage')}" alt="" width="{$mediumSize.width}" height="{$mediumSize.height}" /> use <img src="{$link->getCatImageLink($subcategory.link_rewrite, $subcategory.id_image, 'Newcatimage')}" alt="" width="200" height="50" /> where the 200 and 50 is a size of your new imagetype 1 Link to comment Share on other sites More sharing options...
Runge1980 Posted March 10, 2014 Author Share Posted March 10, 2014 Hi Vekia. Again you had the solution Edited the Controller and it worked fine... Where should i send the gift basket full of beer.... Thx mate. will mark this as solved. Have a nice evening. Link to comment Share on other sites More sharing options...
vekia Posted March 10, 2014 Share Posted March 10, 2014 you're very very welcome glad to hear that i could help you a little i marked whole topic as solved. with regards, Milos Link to comment Share on other sites More sharing options...
Recommended Posts