Store UI, layout, design, look and feel; Discussion on the customer facing pages of your online store. Cascading Style Sheets, Themes, Scriptlets, NVelocity and the components in the ConLib directory.
-
rewardchain
- Lieutenant, Jr. Grade (LT JG)
- Posts: 23
- Joined: Wed Mar 24, 2010 2:42 pm
Post
by rewardchain » Fri Dec 03, 2010 10:31 pm
My products are bulk imported and the product images need to reference a hosted location. On some of the product pages, the hosted imgaes show just fine. For example, use [url]http:/content.hostedsource.com/Large/11391790.jpg[/url] as the Standard Image path. If you then click on the details of the product the image is the red x. The url for that red x is a combo of the site domain and the appended URL ,
http://mysite.com/content.hostedsource. ... 391790.jpg.
After looking at the Show Product 1 scriptlet and the ProductImage.ascx.cs I have determined that this page wants to use the \Products folder to load product images. What is the best way to ignore the local drive and just use the image URl?
Here is the code I am referencing :
Code: Select all
phProductImage.Controls.Add(new LiteralControl("<img id=\"ProductImage\" src=\"" + Page.ResolveClientUrl(imageUrl) + "\" border=\"0\" alt=\"" + Server.HtmlEncode(imageAltText) + "\" />"));
Thanks,
Jason
-
WebDev7
- Lieutenant, Jr. Grade (LT JG)
- Posts: 49
- Joined: Thu Oct 14, 2010 7:25 am
Post
by WebDev7 » Fri Dec 03, 2010 11:29 pm
I dont know if this would work: try to debug (ImageURL) parameter, tweak the string to reflect your hosted company?
-
mazhar
- Master Yoda
- Posts: 5084
- Joined: Wed Jul 09, 2008 8:21 am
-
Contact:
Post
by mazhar » Sat Dec 04, 2010 6:52 am
instead of
Code: Select all
phProductImage.Controls.Add(new LiteralControl("<img id=\"ProductImage\" src=\"" + Page.ResolveClientUrl(imageUrl) + "\" border=\"0\" alt=\"" + Server.HtmlEncode(imageAltText) + "\" />"));
try to use this code block
Code: Select all
phProductImage.Controls.Add(new LiteralControl("<img id=\"ProductImage\" src=\"" + ((imageUrl.StartsWith("~/"))?Page.ResolveClientUrl(imageUrl):imageUrl) + "\" border=\"0\" alt=\"" + Server.HtmlEncode(imageAltText) + "\" />"));
and see if it works
-
rewardchain
- Lieutenant, Jr. Grade (LT JG)
- Posts: 23
- Joined: Wed Mar 24, 2010 2:42 pm
Post
by rewardchain » Sat Dec 04, 2010 10:33 pm
Mazhar, Thanks for the reply. Unfortunately, it didn't work. I am thinking it could be something with Page.ResolveClientUrl