CategoryList is unable to remove RSS icons

Topics: Controls
May 11, 2012 at 10:24 PM

Hi guys

Thank you for some nice blog software, which I have been a happy user of for quite some time.

Yesterday I finally upgraded to version 2.5 and noticed that the RSS icons of my category list was turned on. I usually turn them off because I want to limit subscriptions to my FeedBurner feed.

Anyway, I had a look at the source code and I think a line, that adds the new value back into the dictionary may be missing after blogsShowRssIcon.Remove in the ShowRssIcon property setter in the CategoryList control.

This will make the method look like this (the italic line is not currently there):

set
{
	if (ShowRssIcon == value)
	{
		return;
	}

	blogsShowRssIcon.Remove(Blog.CurrentInstance.Id);
	blogsShowRssIcon.Add(Blog.CurrentInstance.Id, value);
	blogsHtml.Remove(Blog.CurrentInstance.Id);
}

I may or may not have understood how the controls interact with their settings, which is why I am posting this issue here. :-)

Regardless of the above, as I see it, there is currently no way to turn off the RSS icons in the CategoryList control.

I hope this helps in some way.

Coordinator
May 12, 2012 at 4:01 AM

Log in, click "edit widget" in the category list widget header and uncheck "show RSS icon" in the pop up window. This should remove icons from the list, works great for me.

May 12, 2012 at 9:27 AM
Edited May 12, 2012 at 9:47 AM
rtur wrote:

Log in, click "edit widget" in the category list widget header and uncheck "show RSS icon" in the pop up window. This should remove icons from the list, works great for me.


Hi Rtur

I might not have explained myself very clear, sorry about that, but the code above is the exact code called, when performing your steps. It does not respond the way it used to in earlier versions. Which is the reason for my post.

If I uncheck the "Show RSS icon" check box in the pop up window, it will simply keep showing the RSS icon. It do save the setting as showRssIcon=false, but (as I see it) because the setter method removes the instance id from the Dictionary (and never put it back again with the new value) the getter will simply default to true, when called again:

get
{
	Guid blogId = Blog.CurrentInstance.Id;

	if (!blogsShowRssIcon.ContainsKey(blogId))
		blogsShowRssIcon[blogId] = true;

	return blogsShowRssIcon[blogId];
}

I hope this clarifies some stuff. :-)

Coordinator
May 12, 2012 at 12:27 PM

Hi Zillion.  You are correct that code is flawed.  Checking it out now, I see that code was fixed a few months ago (Nov 5 2011).  Here's what the code looks like now:

http://blogengine.codeplex.com/SourceControl/changeset/view/c0c2f03ce721#BlogEngine%2fBlogEngine.NET%2fApp_Code%2fControls%2fCategoryList.cs

set
{
	if (ShowRssIcon == value)
	{
		return;
	}

	blogsShowRssIcon[Blog.CurrentInstance.Id] = value;
	blogsHtml.Remove(Blog.CurrentInstance.Id);
}

With this code, the blogsShowRssIcon dictionary is updated with "value".  And testing it out, it's working, whereas in version 2.5, it was always showing the RSS icon, as you found.

Thanks for bringing this up.  You can update your code as above, or even use the code you suggested -- both work.