Denis,
Thanks for the reply and Sorry for the confusion, let me explain my situation:
1) I want to have "All Blog posts" blog container on the homepage so that all users will see the latest blog posts (from all irrespective of coming from any blog list - that's why I said "All blog post).
2) At the same time I DO NOT want to display 10 blog posts in the blog container on the homepage because you know homepage should not include so many blog posts, homepage should be little bit of everything so on homepage I want latest 2 or 3 blog posts.
3) But when any user go to "Blog" page by clicking on "Blog" from the main menu links - In that case I need 10 blog posts (NOT 2 or 3).
4) Dragging the blog container on home page uses the same code logically that is being used in blog section (when going from menu tabs to blog page / section)
5) The problem is in BlogPostList .ascx (in gallery - in code) If I change this:
<mono:Pager runat="server" ID="pager"
PageSize="10" NumericButtonCount="5" AllowCustomPaging="true"
AutoPaging="false">
to
<mono:Pager runat="server" ID="pager"
PageSize="2" NumericButtonCount="5" AllowCustomPaging="true"
AutoPaging="false">
The homepage does display only 2 blog posts but when I go to "Blog" section from the main menu , (i.e. monox.mono-software.com/blog/posts/) - In this section also only 2 blog posts per page are being displayed.
Solution:
I came up with an idea that in visual studio, I created 2 new .ascx (exact copies of BlogPostList.ascx & BlogContainer.ascx) and named them to BlogPostListHome.ascx & BlogContainerHome.ascx
This is the code of my these 2 new .ascx in which I have changed the path to point to new .ascx
BlogContainerHome.ascx
<%@ Control
Language="C#"
AutoEventWireup="True"
Inherits="MonoSoftware.MonoX.ModuleGallery.Blog.BlogContainer"
Codebehind="BlogContainer.ascx.cs" %>
<%@ Register TagPrefix="MonoX" TagName="BlogPostList" Src="/MonoX/ModuleGallery/Blog/BlogPostListHome.ascx" %>
<%@ Register TagPrefix="MonoX" TagName="BlogPostEdit" Src="/MonoX/ModuleGallery/Blog/BlogPostEdit.ascx" %>
<%@ Register TagPrefix="MonoX" TagName="BlogPostView" Src="/MonoX/ModuleGallery/Blog/BlogPostView.ascx" %>
<%@ Register TagPrefix="MonoX" TagName="BlogSettings" Src="/MonoX/ModuleGallery/Blog/BlogSettings.ascx" %>
<%@ Register TagPrefix="MonoX" TagName="BlogComments" Src="/MonoX/ModuleGallery/Blog/BlogCommentsList.ascx" %>
<
div
class
=
"blog"
>
<
MonoX:BlogPostList
ID
=
"blogPostList"
runat
=
"server"
RssEnabled
=
"true"
ParseCustomTags
=
"Description"
/>
<
MonoX:BlogPostEdit
ID
=
"blogPostEdit"
runat
=
"server"
/>
<
MonoX:BlogPostView
ID
=
"blogPostView"
runat
=
"server"
/>
<
MonoX:BlogSettings
ID
=
"blogSettings"
runat
=
"server"
/>
<
MonoX:BlogComments
ID
=
"blogComments"
runat
=
"server"
/>
</
div
>
BlogPostListHome.ascx
<%@ Control
Language="C#"
AutoEventWireup="true"
Inherits="MonoSoftware.MonoX.ModuleGallery.Blog.BlogPostList"
CodeBehind="BlogPostList.ascx.cs" %>
<%@ Register Namespace="MonoSoftware.Web.Pager" Assembly="MonoSoftware.Web.Pager" TagPrefix="mono" %>
<%@ Register Src="/MonoX/controls/SyntaxHighlighter/SyntaxHighlighter.ascx" TagPrefix="mono" TagName="SyntaxHighlighter" %>
<
mono:SyntaxHighlighter
ID
=
"syntaxHighlighter"
runat
=
"server"
/>
<
asp:Panel
ID
=
"pnlContainer"
runat
=
"server"
>
<
div
class
=
"blog-top-section clearfix"
runat
=
"server"
id
=
"lbHeader"
>
<
div
class
=
"blog-info"
>
<
asp:Literal
runat
=
"server"
ID
=
"ltlH1Open"
><
h1
></
asp:Literal
><
asp:Literal
ID
=
"ltlBlogName"
runat
=
"server"
></
asp:Literal
><
asp:Literal
runat
=
"server"
ID
=
"ltlH1Close"
></
h1
></
asp:Literal
>
<
asp:Literal
ID
=
"ltlBlogDescription"
runat
=
"server"
></
asp:Literal
>
</
div
>
<
div
class
=
"main-options"
>
<
ul
class
=
"first"
id
=
"panFilter"
runat
=
"server"
>
<
li
title="<%= MonoSoftware.MonoX.Resources.BlogResources.BlogPostList_Filter_Title %>">
<
asp:HyperLink
ID
=
"lnkCurrent"
runat
=
"server"
></
asp:HyperLink
>
<
ul
class
=
"level0"
>
<
li
><
asp:HyperLink
ID
=
"lnkFirst"
runat
=
"server"
></
asp:HyperLink
></
li
>
<
li
><
asp:HyperLink
ID
=
"lnkSecond"
runat
=
"server"
></
asp:HyperLink
></
li
>
</
ul
>
</
li
>
</
ul
>
<
asp:HyperLink
runat
=
"server"
ID
=
"lnkComments"
></
asp:HyperLink
>
<
asp:HyperLink
runat
=
"server"
ID
=
"lnkSettings"
></
asp:HyperLink
>
<
asp:HyperLink
runat
=
"server"
ID
=
"lnkAddNew"
CssClass
=
"float-right"
></
asp:HyperLink
>
</
div
>
</
div
>
<
asp:Literal
runat
=
"server"
ID
=
"ltlHeaderSpace"
><
br
/></
asp:Literal
>
<
asp:ListView
ID
=
"lvItems"
runat
=
"server"
>
<
LayoutTemplate
>
<
div
class
=
"clearfix"
>
<
asp:PlaceHolder
runat
=
"server"
ID
=
"itemPlaceholder"
></
asp:PlaceHolder
>
</
div
>
</
LayoutTemplate
>
<
ItemTemplate
>
</
ItemTemplate
>
</
asp:ListView
>
<
asp:Label
runat
=
"server"
ID
=
"lblNoData"
CssClass
=
"empty-list"
></
asp:Label
>
<
mono:Pager
runat
=
"server"
ID
=
"pager"
PageSize
=
"2"
NumericButtonCount
=
"5"
AllowCustomPaging
=
"true"
AutoPaging
=
"false"
>
<
PagerTemplate
>
</
PagerTemplate
>
</
mono:Pager
>
</
asp:Panel
>
Is this the correct approach ?
When I login as admin and click on "Change the look and functionality of the page" (in homepage) and select web parts and in blog tab I do see 2 blogcontainers and the second one works fine with 2 posts per page.
Why I am getting these errors ?
Warning 1 File 'BlogPostList.ascx.cs' was not found.
Warning 4 File 'BlogContainer.ascx.cs' was not found