This project is read-only.

Relatedposts.cs Stop it from displaying pages

Apr 14, 2009 at 10:46 PM

I'm using the standard relatedposts.cs built in and filed under App_Code\Controls

My problem is that this script works more than I want and also displays related pages. 

I see nothing in the source which is connected to pages but I really need to stop it and only find related posts.

can anyone please point me in the right direction?

Apr 14, 2009 at 11:22 PM
In RelatedPosts.cs, add the second line below after the existing first line.

List<IPublishable> relatedPosts = SearchForPosts();
relatedPosts = relatedPosts.FindAll(delegate(IPublishable item) { return item is Post; });
Apr 14, 2009 at 11:35 PM
Thanks Ben

Worked a treat :)