Page 1 of 1

Display thumbnail in CategoryListPage.aspx

Posted: Sat Jul 18, 2015 3:34 pm
by BBHartley
I am finishing an upgrade from 7.01 to the newest version of Gold. Our old CategoryListPage columns had been changed to include the thumbnail. The AdvancedSearch.aspx search result gives me what I want the final output to be, but I am having trouble setting up my custom CategoryListPage. Can anyone provide insight on how to do this? It was seven years ago when I did it the first time... I simply want the SKU column to be replaced with a Thumbnail column.

Thanks in advance for any help provided.

bbhartley

Re: Display thumbnail in CategoryListPage.aspx

Posted: Tue Jul 21, 2015 4:06 am
by rmaweb
Hello BBHartley,

Sorry for the delay in responding. First chance I've had to be at my office computer. Give this a shot:

In /ConLib/CategoryListPage.ascx

Find:

Code: Select all

				                    <th scope="col" class="sku">SKU</th>
				                    <th scope="col" class="itemName" >Name</th>
Replace With:

Code: Select all

				                    <th scope="col" class="itemName"  colspan="2">Name</th>
Find:

Code: Select all

                                <td class="sku">
                                    <asp:Label ID="ProductSku" runat="server" CssClass="sku"></asp:Label>
                                </td>
Replace With:

Code: Select all

                                <td class="itemThumbnail">
                                    <asp:HyperLink ID="ProductThumbnailLink" runat="server" NavigateUrl="#">
                                        <asp:Image ID="ProductThumbnailImage" runat="server" CssClass="itemThumbnail" />
                                    </asp:HyperLink>
                                </td>
In /ConLib/CategoryListPage.ascx.cs

Find:

Code: Select all

                Label productSku = (Label)e.Item.FindControl("ProductSku");
                productSku.Text = product.Sku;
Replace With:

Code: Select all

                HyperLink ProductThumbnailLink = (HyperLink)e.Item.DataItem;
                Image ProductThumbnailImage = (Image)e.Item.DataItem;
                ProductThumbnailLink.NavigateUrl = product.NavigateUrl;
                ProductThumbnailImage.ImageUrl = product.ThumbnailUrl;
                ProductThumbnailImage.AlternateText = product.ThumbnailAltText;
I put in the CSS classes for the table cell and image, but they don't exist anywhere. If you need to do any formatting, you will need to open the Styles.Less file in your theme folder and make whatever changes needed.