Rank: Member
Joined: 12/30/2006(UTC) Posts: 65
|
Hey Gang,
Has anyone adjusted the Product Grid to Display the Large Product image instead of the small?
I Have a copy of the original product grid (named differently) and have it appearing on the site. This specific grid, I'd like to show the larger image size.
I tried to modify this line in the view.ascx.vb file by changing small to medium, but that wasn't enough Dim smallimage As HtmlImage = DirectCast(e.Item.FindControl("imagesmall"), HtmlImage)
this is the matching line on the view.ascx file: <asp:HyperLink ID="lnkImage" runat="server"><img id="imagesmall" runat="server" class="lastproductsviewed"/></asp:HyperLink>
I reviewed the code in the Product template, and the Sub Category 2 template, but it seems more involved in those and can't figure out how to make use of that code for my task.
Any advice would be a great help. Thanks -Dave
|
|
|
|
Rank: Member
Joined: 12/30/2006(UTC) Posts: 65
|
Just giving a check in now that the holidays have passed.
If anyone has guidance on how to get the image in the product grid to display the medium image, instead of the small, it would be greatly appreciated.
I attempted to use code found on the product page templates, but I wasn't able to do so correctly. I was hoping it would be something as quic kas changing the database call from ImageSmall to ImageMedium (whatever the real correct syntax is).
Thanks -Dave
|
|
|
|
Rank: Member
Joined: 8/17/2006(UTC) Posts: 681
|
David, You were close with your change. Here is the code you need:
Dim smallimage As HtmlImage = DirectCast(e.Item.FindControl("imagesmall"), HtmlImage) Dim lnkProduct As HyperLink = DirectCast(e.Item.FindControl("lnkProduct"), HyperLink) If (lnkImage IsNot Nothing) AndAlso (smallimage IsNot Nothing) Then smallimage.Src = Page.ResolveUrl(Utilities.ImageHelper.GetValidImage(p.ImageFileMedium, True)) smallimage.Alt = HttpUtility.HtmlEncode(p.ImageFileMediumAlternateText) lnkImage.NavigateUrl = Utilities.UrlRewriter.BuildUrlForProduct(p, Me.Page.Request)
' Force Image Size ViewUtilities.ForceImageSize(smallimage, smallimage.Src, ViewUtilities.Sizes.Medium, Me.Page) ... Regards, Corneliu. |
|
|
|
|
Rank: Member
Joined: 12/30/2006(UTC) Posts: 65
|
Cornellu,
Thanks so much for that code!! I changed the proper items from small to medium (as you displayed), and it worked perfectly.
Very very much appreciated! -Dave
|
|
|
|
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.