Rank: Member
Joined: 2/3/2007(UTC) Posts: 100
|
When a product link is placed in a category, it comes with IMG, NAME and PRICE. So there are 3 links to a product listing. Let's say I removed the price. So 2 links left - IMG and NAME
I want to combine them in a way that it comes up as one link. See example below:
<a href="/link.com/example.aspx"> <img src="/images/Product/example.jpg" alt="name" border="0" width="180"> <br /> Product Name </a>
BV category.aspx comes with the following:
<div class="recordimage"><a id="recordimageanchor" runat="server" href=""><img id="recordimageimg" runat="server" src="" border="0" alt="" /></a></div> <div class="recordname"><a id="recordnameanchor" runat="server" href=""></a>
Category.ascx.vb file also has coding for that. I couldn't handle it.
How can I modify it? I would appreciate any help.
|
|
|
|
Rank: Member
Joined: 2/3/2007(UTC) Posts: 100
|
I realized that Category.ascx.vb file needs to be modified first. I believe the following part : . . Protected Sub DataList1_ItemDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DataListItemEventArgs) Handles DataList1.ItemDataBound If e.Item.ItemType = ListItemType.Item Or e.Item.ItemType = ListItemType.AlternatingItem Then Dim p As Catalog.Product = CType(e.Item.DataItem, Catalog.Product) If p IsNot Nothing Then Dim destinationLink As String = Utilities.UrlRewriter.BuildUrlForProduct(p, Me.Page.Request) Dim imageUrl As String imageUrl = Page.ResolveUrl(Utilities.ImageHelper.GetValidImage(p.ImageFileSmall, True))
DirectCast(e.Item.FindControl("ImageAnchor"), HtmlAnchor).HRef = destinationLink Dim ProductImage As HtmlImage = DirectCast(e.Item.FindControl("ProductImage"), HtmlImage) ProductImage.Src = imageUrl ProductImage.Alt = p.ProductName & " " & p.Sku
' Force Image Size ViewUtilities.ForceImageSize(ProductImage, p.ImageFileSmall, ViewUtilities.Sizes.Small, Me.Page)
Dim NameAnchor As HtmlAnchor = DirectCast(e.Item.FindControl("NameAnchor"), HtmlAnchor) NameAnchor.HRef = destinationLink NameAnchor.InnerHtml = p.ProductName
Dim SkuAnchor As HtmlAnchor = DirectCast(e.Item.FindControl("SkuAnchor"), HtmlAnchor) SkuAnchor.HRef = destinationLink SkuAnchor.InnerText = p.Sku
Dim PriceAnchor As HtmlAnchor = DirectCast(e.Item.FindControl("PriceAnchor"), HtmlAnchor) PriceAnchor.HRef = destinationLink PriceAnchor.InnerText = p.GetSitePriceForDisplay(0D) Else Dim NameAnchor As HtmlAnchor = DirectCast(e.Item.FindControl("NameAnchor"), HtmlAnchor) NameAnchor.InnerHtml = "Product Could Not Be Located." End If End If End Sub . . .
How do I modify this to make the link come up as follows?
<a href="/link.com/example.aspx"> <img src="/images/Product/example.jpg" alt="name" border="0" width="180"> <br /> Product Name </a>
|
|
|
|
Rank: Member
Joined: 2/3/2007(UTC) Posts: 100
|
Is it possible if can I get some guidence from BV experts? :)
|
|
|
|
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.