Adding PageSize property to blogs

This commit is contained in:
Sebastien Ros
2014-04-28 13:23:03 -07:00
parent fcb29cbf9d
commit 5cac1d526c
3 changed files with 12 additions and 0 deletions

View File

@@ -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)

View File

@@ -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); }
}
}
}

View File

@@ -18,3 +18,9 @@
@Html.LabelFor(m => m.EnableCommentsFeed, T("Render a comments rss feed").Text, new { @class = "forcheckbox" })
<span class="hint">@T("Enable to render the comments rss feed.")</span>
</fieldset>
<fieldset>
@Html.LabelFor(m => m.PostsPerPage, T("Posts per page"))
@Html.TextBoxFor(m => m.PostsPerPage, new { @class = "text small" })
<span class="hint">@T("The number of items to display on the main blog page.")</span>
</fieldset>