I am working with CategoryGridPage4.
How can I add a browse button below the subcategorys? I want it to look just like the "Add to Cart" button.
My goat is to help customers be able to see the difference between a product and a category.
Thanks in advance!
Adding a browse button in a subcategory
-
- Ensign (ENS)
- Posts: 19
- Joined: Thu Oct 29, 2009 5:34 am
Re: Adding a browse button in a subcategory
In category grid page 4 locate following line of code
and then add following line just below it
This will show a browse link under each category pointing to that category display page. If you want to put some browse button image instead then just enclose your image between browse hyperlink tag in place of Browse text.
Code: Select all
<div style="margin-top:10px;margin-bottom:20px" id="Add2CartLinkDiv" runat="server" visible='<%#((CatalogNodeType)Eval("CatalogNodeType")) == CatalogNodeType.Product %>'><uc:AddToCartLink ID="Add2Cart" runat="server" ProductId='<%#Eval("CatalogNodeId")%>' visible='<%#((CatalogNodeType)Eval("CatalogNodeType")) == CatalogNodeType.Product %>' /></div>
Code: Select all
<asp:HyperLink ID="BrowseLink" runat="server" NavigateUrl='<%#Eval("NavigateUrl")%>' Visible='<%#((CatalogNodeType)Eval("CatalogNodeType")) == CatalogNodeType.Category %>'>Browse</asp:HyperLink>
-
- Ensign (ENS)
- Posts: 19
- Joined: Thu Oct 29, 2009 5:34 am
Re: Adding a browse button in a subcategory
This worked great, but one thing I did not mention is we have links in the categories also.
What can we add to the code to get it to display on the links also?
What can we add to the code to get it to display on the links also?
Re: Adding a browse button in a subcategory
All you need to make is visible on catalog node of type Link as well
Code: Select all
<asp:HyperLink ID="BrowseLink" runat="server" NavigateUrl='<%#Eval("NavigateUrl")%>' Visible='<%#(((CatalogNodeType)Eval("CatalogNodeType")) == CatalogNodeType.Category) || (((CatalogNodeType)Eval("CatalogNodeType")) == CatalogNodeType.Link) %>'>Browse</asp:HyperLink>