Simple Category List Images
- Cornerstone
- Ensign (ENS)
- Posts: 18
- Joined: Wed Nov 12, 2008 10:34 am
Simple Category List Images
Is there a way to have images instead of text links for the categories?
I attempted this making all the image the same as the text of the "Name" of the category...
<asp:HyperLink ID="CategoryLink" runat="server" ImageUrl="images/<%#Eval("Name")%>.jpg" NavigateUrl="<%#Eval("NavigateUrl")%>"></asp:HyperLink>
instead of this...
<asp:HyperLink ID="CategoryLink" runat="server" Text='<%#Eval("Name")%>' NavigateUrl='<%#Eval("NavigateUrl")%>'></asp:HyperLink>
and this will not work. I get an error. I don't know ASP.Net very well and would appriciate any help. Thanks!
Derek
I attempted this making all the image the same as the text of the "Name" of the category...
<asp:HyperLink ID="CategoryLink" runat="server" ImageUrl="images/<%#Eval("Name")%>.jpg" NavigateUrl="<%#Eval("NavigateUrl")%>"></asp:HyperLink>
instead of this...
<asp:HyperLink ID="CategoryLink" runat="server" Text='<%#Eval("Name")%>' NavigateUrl='<%#Eval("NavigateUrl")%>'></asp:HyperLink>
and this will not work. I get an error. I don't know ASP.Net very well and would appriciate any help. Thanks!
Derek
Re: Simple Category List Images
It sounds like a path problem. You have to provide more information for image location like
Code: Select all
<asp:HyperLink ID="CategoryLink" runat="server" ImageUrl="App_Themes/YourTheme/images/<%#Eval("Name")%>.jpg" NavigateUrl="<%#Eval("NavigateUrl")%>"></asp:HyperLink>
- Cornerstone
- Ensign (ENS)
- Posts: 18
- Joined: Wed Nov 12, 2008 10:34 am
Re: Simple Category List Images
Got the same error...
[[ConLib:SimpleCategoryList]] The server tag is not well formed.
[[ConLib:SimpleCategoryList]] The server tag is not well formed.
Re: Simple Category List Images
Use this code
Code: Select all
<asp:HyperLink ID="CategoryLink" runat="server" ImageUrl='App_Themes/YourTheme/images/<%#Eval("Name")%>.jpg' NavigateUrl="<%#Eval("NavigateUrl")%>"></asp:HyperLink>
- Cornerstone
- Ensign (ENS)
- Posts: 18
- Joined: Wed Nov 12, 2008 10:34 am
Re: Simple Category List Images
That code did put image place holders in, but the pathing was wrong and the links were wrong.
Example is...
Image url = http://www.site.com/ConLib/App_Themes/T ... %25%3E.jpg
Link url = http://www.site.com/ConLib/%22%3C%25#Ev ... Url%22)%25
Any ideas?
Thanks again.
Example is...
Image url = http://www.site.com/ConLib/App_Themes/T ... %25%3E.jpg
Link url = http://www.site.com/ConLib/%22%3C%25#Ev ... Url%22)%25
Any ideas?
Thanks again.
Re: Simple Category List Images
Here is the modified version of SimpleCategoryList control, check this out.
Re: Simple Category List Images
One thing more you need to update the following line in the code file so that it picks the image from your current template.
For this you will have to change Ablecommerce to your custom store theme name if you are using some other store theme. It would be something like
Just replace your YourStoreThemeName with actual name of your store current theme.
Code: Select all
string imagePath = "~/App_Themes/AbleCommerce/images/" + name + ".jpg";
Code: Select all
string imagePath = "~/App_Themes/YourStoreThemeName/images/" + name + ".jpg";
- Cornerstone
- Ensign (ENS)
- Posts: 18
- Joined: Wed Nov 12, 2008 10:34 am
Re: Simple Category List Images
Thanks so much! It worked perfectly. I really appriciate you helping me in figuring this out.