diff --git a/src/Orchard.Web/Modules/Orchard.Blogs/Controllers/BlogController.cs b/src/Orchard.Web/Modules/Orchard.Blogs/Controllers/BlogController.cs index 537f2e9f4..314617882 100644 --- a/src/Orchard.Web/Modules/Orchard.Blogs/Controllers/BlogController.cs +++ b/src/Orchard.Web/Modules/Orchard.Blogs/Controllers/BlogController.cs @@ -69,6 +69,7 @@ namespace Orchard.Blogs.Controllers { return new HttpUnauthorizedResult(); } + pager.PageSize = blogPart.PostsPerPage; _feedManager.Register(blogPart, _services.ContentManager.GetItemMetadata(blogPart).DisplayText); var blogPosts = _blogPostService.Get(blogPart, pager.GetStartIndex(), pager.PageSize) diff --git a/src/Orchard.Web/Modules/Orchard.Blogs/Models/BlogPart.cs b/src/Orchard.Web/Modules/Orchard.Blogs/Models/BlogPart.cs index c6e74f056..662383802 100644 --- a/src/Orchard.Web/Modules/Orchard.Blogs/Models/BlogPart.cs +++ b/src/Orchard.Web/Modules/Orchard.Blogs/Models/BlogPart.cs @@ -27,5 +27,10 @@ namespace Orchard.Blogs.Models { get { return this.Retrieve(x => x.EnableCommentsFeed, false); } set { this.Store(x => x.EnableCommentsFeed, value); } } + + public int PostsPerPage { + get { return this.Retrieve(x => x.PostsPerPage, 10); } + set { this.Store(x => x.PostsPerPage, value); } + } } } \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.Blogs/Views/EditorTemplates/Parts.Blogs.Blog.Fields.cshtml b/src/Orchard.Web/Modules/Orchard.Blogs/Views/EditorTemplates/Parts.Blogs.Blog.Fields.cshtml index 9623f44db..3792ccfe0 100644 --- a/src/Orchard.Web/Modules/Orchard.Blogs/Views/EditorTemplates/Parts.Blogs.Blog.Fields.cshtml +++ b/src/Orchard.Web/Modules/Orchard.Blogs/Views/EditorTemplates/Parts.Blogs.Blog.Fields.cshtml @@ -18,3 +18,9 @@ @Html.LabelFor(m => m.EnableCommentsFeed, T("Render a comments rss feed").Text, new { @class = "forcheckbox" }) @T("Enable to render the comments rss feed.") + +
+ @Html.LabelFor(m => m.PostsPerPage, T("Posts per page")) + @Html.TextBoxFor(m => m.PostsPerPage, new { @class = "text small" }) + @T("The number of items to display on the main blog page.") +
\ No newline at end of file