closeupman Posted December 23, 2013 Share Posted December 23, 2013 (edited) Hi, Is there anyway to define an image size different for the featured products that will be displayed on the front page, from the image size for the products on other pages? I want bigger images on the home page, but for my categories I want smaller images so I can use a grid. I've tried playing with product.css and have had a little success in displaying the images at their true size, but it still only allows one. I was able to get a second one but it was cut off. I played with: #product_list_grid a.product_img_link#product_list_grid li www.sitinuriatistudio.com (main page) http://www.sitinuriatistudio.com/name-portraits/ I was looking at the images in the preference page of the B.O. and was hoping there was an easy way to do this. Thanks. Edited December 24, 2013 by closeupman (see edit history) Link to comment Share on other sites More sharing options...
Paulito Posted December 23, 2013 Share Posted December 23, 2013 Good morning Why not go to: Preferences > Images > and create a new image size, for instance, home_default2, and make this size 180px x 180px ( or whatever you want) then go to: public_html/your store/modules/homefeatured/homefeatured.tpl {$link->getImageLink($product.link_rewrite, $product.id_image, 'home_default')|escape:'html'}" height="{$homeSize.height}" width="{$homeSize.width}" alt=" Then change 'home_default' to 'home_default2' You will need to play around with your css Anyway, I am not an expert but it may help to point you in the right direction. Paul 2 Link to comment Share on other sites More sharing options...
Sharak Posted December 23, 2013 Share Posted December 23, 2013 That's almost exactly how it should be done, Paulito The thing is nowadays /modules/homefeatured/homefeatured.tpl is overriden by /themes/Your_theme/modules/homefeatured/homefeatured.tpl so this is the file that should be edited. Link to comment Share on other sites More sharing options...
closeupman Posted December 23, 2013 Author Share Posted December 23, 2013 That's almost exactly how it should be done, Paulito The thing is nowadays /modules/homefeatured/homefeatured.tpl is overriden by /themes/Your_theme/modules/homefeatured/homefeatured.tpl so this is the file that should be edited. Good morning Why not go to: Preferences > Images > and create a new image size, for instance, home_default2, and make this size 180px x 180px ( or whatever you want) then go to: public_html/your store/modules/homefeatured/homefeatured.tpl {$link->getImageLink($product.link_rewrite, $product.id_image, 'home_default')|escape:'html'}" height="{$homeSize.height}" width="{$homeSize.width}" alt=" Then change 'home_default' to 'home_default2' You will need to play around with your css Anyway, I am not an expert but it may help to point you in the right direction. Paul Thanks Paul and Sharak. I'll try that out later and let you know how it works out. What if I put a homefeatured.tpl in the overrides folder? would that be better for future proofing? Thanks again Link to comment Share on other sites More sharing options...
Sharak Posted December 23, 2013 Share Posted December 23, 2013 (edited) Not really. I think /Override folder is for overriding core files like classes, controllers etc. not modules' tpl files Edited December 23, 2013 by Sharak (see edit history) 1 Link to comment Share on other sites More sharing options...
vekia Posted December 24, 2013 Share Posted December 24, 2013 you can put homefeatured.tpl file in themes/your_theme/modules/homefeatured/ directory then original module file will be overrided by your theme 1 Link to comment Share on other sites More sharing options...
closeupman Posted December 24, 2013 Author Share Posted December 24, 2013 (edited) Good morning Why not go to: Preferences > Images > and create a new image size, for instance, home_default2, and make this size 180px x 180px ( or whatever you want) then go to: public_html/your store/modules/homefeatured/homefeatured.tpl {$link->getImageLink($product.link_rewrite, $product.id_image, 'home_default')|escape:'html'}" height="{$homeSize.height}" width="{$homeSize.width}" alt=" Then change 'home_default' to 'home_default2' You will need to play around with your css Anyway, I am not an expert but it may help to point you in the right direction. Paul I did this, but get a Question Mark for the images, I did the regenerate thumbnails to make sure as well. Do I need to create these thumbnails myself or will prestashop do it? (which it obvisously hasn't) forgot to click PRODUCTS to enable it Images show up now, but are 124x124, not the 200x200, even though they reference the new image preference?! Edited December 24, 2013 by closeupman (see edit history) Link to comment Share on other sites More sharing options...
Paulito Posted December 24, 2013 Share Posted December 24, 2013 Good morning I think you have missed doing something: Please see below; http://screencast.com/t/P7LhujC4 Have you changed the code correctly in: public_html/your store/themes/default/modules/homefeatured/homefeatured.tpl See below: {$link->getImageLink($product.link_rewrite, $product.id_image, 'home_default2')|escape:'html'}" height="{$homeSize2.height}" width="{$homeSize2.width}" alt=" And if it works for you then you need to play with the css to make everything fit correctly Hope this makes sense Paul 1 Link to comment Share on other sites More sharing options...
closeupman Posted December 24, 2013 Author Share Posted December 24, 2013 See below: {$link->getImageLink($product.link_rewrite, $product.id_image, 'home_default2')|escape:'html'}" height="{$homeSize2.height}" width="{$homeSize2.width}" alt=" And if it works for you then you need to play with the css to make everything fit correctly Hope this makes sense Paul Hi Paul, That did it! Thanks. I didn't think about changing the homesize, because that was a total different name from the homedefaultDF I was using for the image. Thanks again 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