Customize icons for every categories

Topics: ASP.NET 2.0, Business Logic Layer, Controls, Themes
Jun 23, 2013 at 5:16 PM
Hi
it's possible to customize and change the default icons of blogengine for every categories.???
Can you help me?
Thanks
Fabry
Jun 23, 2013 at 11:09 PM
Al Nyveldt wrote a post awhile back about adding default images for each category. Not sure if that's what you want, but it might be worth a look.
Jun 24, 2013 at 1:44 PM
mmm i think that the post of Nyveldt speak about posts of each category, my question is for widget category Post... and for to change icon RSS of each category that you display...
Jun 24, 2013 at 2:59 PM
So are you talking about the feed icons in the category widget that typically appear to the left of the category text?
Jun 24, 2013 at 3:06 PM
Yes... those!
Jun 24, 2013 at 4:11 PM
Not sure why you want to do that, but here's one possible way.

In folder App_Code/Controls you want to look at CategoryList.cs, locate the code as follows replacing the commented out line with the line below it.
if (this.ShowRssIcon)
                {
                    var img = new HtmlImage
                        {
                            //Src = string.Format("{0}pics/rssButton.png", Utils.RelativeWebRoot),
                            Src = string.Format("{0}feedIcons/{1}.jpg", Utils.RelativeWebRoot, cat.Title),
                            Alt =
                                string.Format(
                                    "{0} feed for {1}", BlogSettings.Instance.SyndicationFormat.ToUpperInvariant(), key)
                        };
                    img.Attributes["class"] = "rssButton";

                    var feedAnchor = new HtmlAnchor { HRef = cat.FeedRelativeLink };
                    feedAnchor.Attributes["rel"] = "nofollow";
                    feedAnchor.Controls.Add(img);

                    li.Controls.Add(feedAnchor);
                }
Create a new folder at the same level as pics("feedIcons" in this example).
This folder should contain images for each category with names that match your category names exactly(in this example having .jpg extension).

In CSS you can add some style:
#categorylist img.rssButton {
    width:20px;
    height:20px;
}
Jun 24, 2013 at 4:22 PM
Great Andy, when i back to home i will try it...

Thank you very much!
Jun 25, 2013 at 9:38 AM
Your code is perfect

Thank you very much Andy