Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Spree replace default Image / noimage

I am working on a Rails project which involves Spree 1.3.2 and I need to change the default image (noimage) in Spree, but so far found no way to do it. I searched through the documentation, went through the admin section, but all failed.

I have been overriding the default layouts for Spree with Slim templates by following the same name. I located the noimage in app\assets\images\noimage\ folder in the source. So I created the path and copied my custom images there. But the image link still shows the old ugly spree default image.

How can this be accomplished? I do not like to edit core files, something like an override would be great.

like image 432
Ziyan Junaideen Avatar asked May 05 '13 18:05

Ziyan Junaideen


1 Answers

To override the no-image placeholder of spree. Create the following folder in your rails project

app/assets/images/noimage

Create the following image files with the png file extension. The name and file extension is crucial here otherwise you wouldn't override spree's default version

  • large.png
  • mini.png
  • product.png
  • small.png

Make sure you matched the resolution of the spree's default images when you are creating the no-image assets.

large(240x240)
mini(48x48)
product(240x240)
small(100x100)
like image 65
Kenny Chan Avatar answered Sep 28 '22 09:09

Kenny Chan