Braini Posted January 13, 2017 Share Posted January 13, 2017 Hey I'm trying to show the sucategory images in large. Therefor I adjusted in the category.tpl the following code: {if $subcategory.id_image} <img class="replace-2x" src="{$link->getCatImageLink($subcategory.link_rewrite, $subcategory.id_image, 'medium_default')|escape:'html':'UTF-8'}" alt="" width="{$mediumSize.width}" height="{$mediumSize.height}" /> {else} <img class="replace-2x" src="{$img_cat_dir}{$lang_iso}-default-medium_default.jpg" alt="" width="{$mediumSize.width}" height="{$mediumSize.height}" /> To this code: {if $subcategory.id_image} <img class="replace-2x" src="{$link->getCatImageLink($subcategory.link_rewrite, $subcategory.id_image, 'large_default')|escape:'html':'UTF-8'}" alt="" width="{$largeSize.width}" height="{$largeSize.height}" /> {else} <img class="replace-2x" src="{$img_cat_dir}{$lang_iso}-default-medium_default.jpg" alt="" width="{$mediumSize.width}" height="{$mediumSize.height}" /> In this case the images are shown correct, but the default image is not more shown, only a question mark. Why is this happening? And when I change this code... <img class="replace-2x" src="{$img_cat_dir}{$lang_iso}-default-medium_default.jpg" alt="" width="{$mediumSize.width}" height="{$mediumSize.height}" /> ...to a custom default jpg but nothing happens. What am I doing wrong? Anybody an idea? Link to comment Share on other sites More sharing options...
yaniv14 Posted January 13, 2017 Share Posted January 13, 2017 Do you have large_default images for category? Check Preferences -> Images Link to comment Share on other sites More sharing options...
Braini Posted January 13, 2017 Author Share Posted January 13, 2017 Yes it's there. As you see in the picture attached the large subcategory images are displayed. But if there is no subcategory image uploaded to prestashop, it should refer to the {$lang_iso}-default-medium_default.jpg image, which is not working... Link to comment Share on other sites More sharing options...
yaniv14 Posted January 13, 2017 Share Posted January 13, 2017 Do you have an image file named: 'en-default-medium_default.jpg' inside 'img/c' folder? Of course the 'en' is just for english version. Check with inspect element to see what the img prints. Link to comment Share on other sites More sharing options...
Braini Posted January 13, 2017 Author Share Posted January 13, 2017 Great this was it. Thanks a lot. The de-default-large_default.jpg was not in the folder. Now its working. But there is still one strange thing: When I inspect the element, the image is refering to the de-default-large_default.jpg. Shoulden't it refer to the de-default-medium_default.jpg as it is written in the category.tpl file? <img class="replace-2x" src="{$img_cat_dir}{$lang_iso}-default-medium_default.jpg" alt="" width="{$mediumSize.width}" height="{$mediumSize.height}" /> Link to comment Share on other sites More sharing options...
yaniv14 Posted January 13, 2017 Share Posted January 13, 2017 Yes, it should. perhaps you are looking in the wrong file or the wrong theme or maybe you are in the correct file but on the wrong line. Link to comment Share on other sites More sharing options...
Braini Posted January 13, 2017 Author Share Posted January 13, 2017 You are probably right. Anyway it works now for me now and I'll keep it this way Thank you for your assistance. 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