For unknown reason, AC does not find some images in the Assets folder.
It appears to be file names that contain spaces.
Eg, look here:
http://www.thecountrycaregroup.com.au/V ... 08175.aspx
The image "SM 45011.jpg" ,"SM 45011_i.jpg" "SM 45011_t.jpg" does exist on the server.
I dug into the code ConLib/ProductImage.ascx.cs, and for unknown reason it just doesn't load the images. As I don't have the source code for AC, I cannot debug further.
See attachment showing
Product image with spaces in filename not loaded
Re: Product image with spaces in filename not loaded
What version of AC are you using? Spaces in image names is working okay for me.
However, you can modify the Conlib\ProductImage.ascx.cs code to explicitly change spaces to the HTML equivalent by doing this:
change:
to:
See if that fixes your problem.
However, you can modify the Conlib\ProductImage.ascx.cs code to explicitly change spaces to the HTML equivalent by doing this:
change:
Code: Select all
phProductImage.Controls.Add(new LiteralControl("<img id=\"ProductImage\" src=\"" + Page.ResolveUrl(imageUrl) + "\" border=\"0\" alt=\"" + Server.HtmlEncode(imageAltText) + "\" />"));
Code: Select all
phProductImage.Controls.Add(new LiteralControl("<img id=\"ProductImage\" src=\"" + Page.ResolveUrl(imageUrl).Replace(" ","%20") + "\" border=\"0\" alt=\"" + Server.HtmlEncode(imageAltText) + "\" />"));
Re: Product image with spaces in filename not loaded
Hi David,
Thanks for the reply. I am using 7.0.7.14600. Just so its clear, this is using images based on SKU, from the Assets/ProductImages directory.
It's strange because it doesn't load the list of images into the Product images (see how there are no elements in the Product.Images property in the screenshot of debug).
It just doesn't load them!
I see this behaviour if the filename has equal sign, or space character.
I ended up writing some extra code to load them properly, though I have had to edit the website pages to integrate it. Not ideal, but at least my site looks OK now.
I had to edit CategoryGrid.ascx/cs FeaturedGrid.ascx/cs and ProductImage.ascx/cs - there's probalby couple that I still have to edit to complete the work. :-^
pat.
Thanks for the reply. I am using 7.0.7.14600. Just so its clear, this is using images based on SKU, from the Assets/ProductImages directory.
It's strange because it doesn't load the list of images into the Product images (see how there are no elements in the Product.Images property in the screenshot of debug).
It just doesn't load them!
I see this behaviour if the filename has equal sign, or space character.
I ended up writing some extra code to load them properly, though I have had to edit the website pages to integrate it. Not ideal, but at least my site looks OK now.
I had to edit CategoryGrid.ascx/cs FeaturedGrid.ascx/cs and ProductImage.ascx/cs - there's probalby couple that I still have to edit to complete the work. :-^
pat.