Rank: Member
Joined: 12/30/2006(UTC) Posts: 65
|
Hey Gang,
I'm using the Product Grid Content Block to show a Feature Product on the Homepage. Actually, I made a copy of the Product Grid Control folder and renamed it Homepage Feature, and all works fine.
However, the Product Grid only shows the Product Image and Product Name (linked).
How can I pull in a few more attributes like short description and price?
I think I have found the code locations to add to in view.asx.vb. But I'm not completely up to speed on .net syntax, and don't know the proper values for FindControl("") for all thhe various items
Dim lnkImage As HyperLink = DirectCast(e.Item.FindControl("lnkImage"), HyperLink) Dim smallimage As HtmlImage = DirectCast(e.Item.FindControl("imagesmall"), HtmlImage) Dim lnkProduct As HyperLink = DirectCast(e.Item.FindControl("lnkProduct"), HyperLink)
Can I add another of those lines to call in the Short description, and others to call in other product items?
If I'm on the right path, would someone mind advising how to follow through. Or suggest a better method?
Thanks -D
|
|
|
|
Rank: Member
Joined: 12/30/2006(UTC) Posts: 65
|
Hi Again,
I found some success.
On a hunch, I dug into the Category Detail List template, since I remember it showed the short description.
I borrowed this code from the bv file: ' Short Description Dim litDes As Web.UI.WebControls.Literal = DirectCast(e.Item.FindControl("recordshortdescriptionfield"), Literal) If litDes IsNot Nothing Then litDes.Text = p.ShortDescription End If
Then, I borrowed this from the ascx page: <div class="recordshortdescription"> <asp:Literal ID="recordshortdescriptionfield" runat="server"></asp:Literal> </div>
....and it worked. I just pasted the Category Detail List snipets, into the counterparts of the Product Grid Content Block and it worked.
There are some other items I'd like to pull in and will test out over the next day or so.
Does anyone disagree with what I'm doing? Should I use a different method?
Thanks -D
|
|
|
|
Rank: Member
Joined: 3/15/2007(UTC) Posts: 126
|
There is an easier way to do it with the code already in there. When we talk I can go over it with you. |
|
|
|
|
Rank: Member
Joined: 12/30/2006(UTC) Posts: 65
|
If you wouldn't mind sharing with the forum, I'd love the advice on adding a Detail and/or Add to Cart Button.
Trying to pull that from the Category Detail template is bombing on me, while I was able to rig the Short Description and Price that way.
Thanks again -Dave
|
|
|
|
Rank: Member
Joined: 4/10/2006(UTC) Posts: 462
|
Hi Dave,
Depending on exacting what you are trying to accomplish, the product grid may not be the best starting point for you. If you are simply looking to feature 1 product at a time, the product grid adds a lot of overhead due to the use of the datalist design (the block was intended to display multiple products). Using the product rotator may be a beter starting point for you.
If you provide some feedback on what whether my assumption (1 product at a time) is right or wrong, I would be able to help you further. |
Netriplex Corporation<br /> |
|
|
|
Rank: Member
Joined: 12/30/2006(UTC) Posts: 65
|
Caplink, thanks so much for the assist!
Yes, in this instance it is just one product.
I have another instance that shows 3 secondary feature products, so I suspect the Product Grid is good for that.
I didn't consider the product rotator (<- BV Rookie :>)
I added the Product Rotator to the page, and have the creative customizations in place. Unfortunately I can't use the same code for the rotator that I did for the product grid.
Any assist to add Short Description, Price, and Details would be great.
Thanks again, -Dave
|
|
|
|
Rank: Member
Joined: 12/30/2006(UTC) Posts: 65
|
I've made some progress, but not where I'm hoping to land. I studied the customization forum and came across a useful post: http://forums.bvcommerce...43008&g=43127#m43127That helped me get the MSRP price to display, which was cool. But I was hoping to take what I learned from implementing that as well as the Short Description and be able to add other product attributes. Unfortunately, I haven't reached that goal yet. I attempted to modify the MSRP add-in to get rid of the hyperlink, by changing it to literal. I didn't succeed and ended up with an object reference error As before, any assist in adding product attributes to content blocks would be greatly appreciated. Thanks -D
|
|
|
|
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.