Feature request - setting nbr of posts independently for "normal" pages and when posts listed by tag or category

Aug 20, 2011 at 2:42 PM

Just installed BlogEngine.NET for my site aspnetperformance.com. Great product overall, but there are a few annoying shortcomings.

Because my posts are pretty long, I want to show only one per page. But on pages that show posts by category, I want to show a list of posts, with only their description - that makes it look like a search listing. Problem is that in the current version of BlogEngine.NET, there is only one setting for number of posts per page (Posts per page on Basic Settings page). So either you wind up with a really long home page with multiple posts, or you set "Posts per page" to 1, but than you get only 1 post description on pages showing posts by category.

It would be really good if a new input box was introduced on the Basic Settings page, so you can set "Posts per category/tag page" independently from "Posts per page".

Just in case anybody else is having this issue, I found a work around by hacking method Page_Load in default.aspx.cs:

Replace

            PostList1.Posts = Post.Posts.ConvertAll(new Converter<Post, IPublishable>(delegate(Post p) { return p as IPublishable; }));

By

            List<IPublishable> allPosts = Post.Posts.ConvertAll(new Converter<Post, IPublishable>(delegate(Post p) { return p as IPublishable; }));
            if ((allPosts == null) || (allPosts.Count < 1))
            {
                PostList1.Posts = allPosts;
            }
            else
            {
                // Set PostList1.Posts to a list containing only the first post
                IPublishable firstPost = allPosts[0];
                PostList1.Posts = new List<IPublishable>(new IPublishable[] { firstPost });
            }

Using Take(1) would have been the easiest solution, but Linq requires the System.Core.dll assembly which my hosting provider doesn't seem to have in their CAG.

Also, there seems to be no way to suppress the date on blog posts. I unchecked "Add date to post links" on the Basic Settings page, to no avail.

And there seems to be no way to suppress the By line.

Matt Perdeck