MonoX support board

Start the conversation, ask questions and share tips and solutions with fellow developers.

Non-registered users can only browse through our support boards. Please register now if you want to post your questions. It takes a second and it is completely free. Alternatively, you can log in without registration using your credentials at major sites such as Google, Microsoft Live, OpenId, Facebook, LinkedIn or Yahoo.

How to get ALL BLOG POSTS on the homepage ?  (Mono Support )

13157 put(a) pogledan, 7 odgovor(a) 18.7.2012. 11:31:58Kreirao(la) super
super

super

18.7.2012. 11:31:59
How to get ALL BLOG POSTS on the homepage ? I would like to display content of Blog.aspx page on the homepage, how to do that ?
Ovaj sadržaj još nije ocijenjen. 
6018 Reputacija 709 Ukupno objava
khorvat

khorvat

18.7.2012. 13:15:20
Hi,

you will need to instantiate BlogContainer module on your home page e.g.
<%@ Register Assembly="MonoX" Namespace="MonoSoftware.MonoX" TagPrefix="portal" %>
<%@ Register TagPrefix="MonoX" TagName="BlogContainer" Src="/MonoX/ModuleGallery/Blog/BlogContainer.ascx" %>
 
<portal:PortalWebPartZoneTableless HeaderText='<%$ Code: PageResources.Zone_LeftPartZone %>' ID="leftPartZone" runat="server" Width="100%" ChromeTemplateFile="LeftColumn.htm">
      <ZoneTemplate>
          <MonoX:BlogContainer ID="blogContainer" runat="server" UsePrettyPhoto="true" DateFormatString="d"
          RelatedContentVisible="false" EnableSyntaxHighlighter="true" GravatarRenderType="NotSet" />
      </ZoneTemplate>
  </portal:PortalWebPartZoneTableless>
Note: Put the module in the PortalWebPartZoneTableless only if you want to dynamically administer the module, if not please us this

<MonoX:BlogContainer ID="blogContainer" runat="server" UsePrettyPhoto="true" DateFormatString="d"
          RelatedContentVisible="false" EnableSyntaxHighlighter="true" GravatarRenderType="NotSet" />

Also note that BlogContainer will use the BlogSlug from the url if any, if not you need to manually set the BlogSlug if you want to bound the module to specific blog.


Regards
Ovaj sadržaj još nije ocijenjen. 
15993 Reputacija 2214 Ukupno objava
khorvat

khorvat

18.7.2012. 13:16:30
One more thing you need to change the URL rewriting if you want fancy URLs, you can find them in the web.config

<!-- dynamic blog post rules, can be used regardless of the actual name of the page that holds blog parts -->
<rewrite url="^(.*)/(.*)/post/(.*)/(.*)/(.*)/BlogCommentsPageNo/(.*)/BlogFilesPageNo/(.*)/(\?(.+))?$" to="$1/$2.aspx?BlogSlug=$3&BlogPostId=$4&BlogCommentsPageNo=$6&BlogFilesPageNo=$7&$9" name="BlogPostCommentsFiles" defaultPage="/Blog.aspx" urlPattern="/{PageName}/post/{Blog.Slug}/{IdentityId}/{Slug}/" />
<rewrite url="^(.*)/(.*)/post/(.*)/(.*)/(.*)/BlogFilesPageNo/(.*)/BlogCommentsPageNo/(.*)/(\?(.+))?$" to="$1/$2.aspx?BlogSlug=$3&BlogPostId=$4&BlogFilesPageNo=$6&BlogCommentsPageNo=$7&$9" name="BlogPostFilesComments" defaultPage="/Blog.aspx" urlPattern="/{PageName}/post/{Blog.Slug}/{IdentityId}/{Slug}/" />
<rewrite url="^(.*)/(.*)/post/(.*)/(.*)/(.*)/BlogFilesPageNo/(.*)/(\?(.+))?$" to="$1/$2.aspx?BlogSlug=$3&BlogPostId=$4&BlogFilesPageNo=$6&$8" name="BlogPostFiles" defaultPage="/Blog.aspx" urlPattern="/{PageName}/post/{Blog.Slug}/{IdentityId}/{Slug}/" />
<rewrite url="^(.*)/(.*)/post/(.*)/(.*)/(.*)/BlogCommentsPageNo/(.*)/(\?(.+))?$" to="$1/$2.aspx?BlogSlug=$3&BlogPostId=$4&BlogCommentsPageNo=$6&$8" name="BlogPostComments" defaultPage="/Blog.aspx" urlPattern="/{PageName}/post/{Blog.Slug}/{IdentityId}/{Slug}/" />
<rewrite url="^(.*)/(.*)/post/(.*)/(.*)/(.*)/(\?(.+))?$" to="$1/$2.aspx?BlogSlug=$3&BlogPostId=$4&$7" name="BlogPost" defaultPage="/Blog.aspx" urlPattern="/{PageName}/post/{Blog.Slug}/{IdentityId}/{Slug}/" />
<rewrite url="^(.*)/(.*)/posts/(.*)/BlogPostPage/(.*)/(\?(.+))?$" to="$1/$2.aspx?BlogSlug=$3&BlogPostPage=$4&$6" name="BlogPostsPaged" defaultPage="/Blog.aspx" urlPattern="/{PageName}/posts/{Slug}/BlogPostPage/{PageNo}/" />
<rewrite url="^(.*)/(.*)/posts/(.*)/(\?(.+))?$" to="$1/$2.aspx?BlogSlug=$3&$5" name="BlogPosts" defaultPage="/Blog.aspx" urlPattern="/{PageName}/posts/{Slug}/" />
<rewrite url="^(.*)/(.*)/search/(.*)/(.*)/(.*)/(\?(.+))?$" to="$1/$2.aspx?BlogSlug=$3&SearchAction=$4&SearchValue=$5&$7" name="BlogSearch" defaultPage="/Blog.aspx" urlPattern="/{PageName}/search/{Slug}/{SearchAction}/{SearchValue}/" />
<rewrite url="^(.*)/(.*)/blog-tag/(.*)/(.*)/(\?(.+))?$" to="$1/$2.aspx?BlogSlug=$3&SearchAction=tag&SearchValue=$4&$6" name="BlogTag" defaultPage="/Blog.aspx" urlPattern="/{PageName}/blog-tag/{Slug}/{Tag}/" />
<rewrite url="^(.*)/(.*)/settings/(.*)/(\?(.+))?$" to="$1/$2.aspx?ShowBlogSettings=true&BlogSlug=$3&$5" name="BlogSettings" defaultPage="/Blog.aspx" urlPattern="/{PageName}/settings/{Slug}/" />
<rewrite url="^(.*)/(.*)/comments/(.*)/BlogCommentsPageNo/(.*)/(\?(.+))?$" to="$1/$2.aspx?ShowBlogCommentsAdmin=true&BlogSlug=$3&BlogCommentsPageNo=$4&$6" name="BlogCommentsAdminComments" defaultPage="/Blog.aspx" urlPattern="/{PageName}/comments/{Slug}/" />
<rewrite url="^(.*)/(.*)/comments/(.*)/(\?(.+))?$" to="$1/$2.aspx?ShowBlogCommentsAdmin=true&BlogSlug=$3&$5" name="BlogCommentsAdmin" defaultPage="/Blog.aspx" urlPattern="/{PageName}/comments/{Slug}/" />
<rewrite url="^(.*)/(.*)/edit/(.*)/(.*)/(.*)/(\?(.+))?$" to="$1/$2.aspx?BlogSlug=$3&BlogPostId=$4&BlogEditMode=true&$7" name="BlogPostEdit" defaultPage="/Blog.aspx" urlPattern="/{PageName}/edit/{Blog.Slug}/{IdentityId}/{Slug}/" />
<rewrite url="^(.*)/(.*)/insert/(.*)/(\?(.+))?$" to="$1/$2.aspx?BlogSlug=$3&BlogInsertMode=true&$5" name="BlogPostInsert" defaultPage="/Blog.aspx" urlPattern="/{PageName}/insert/{Slug}/" />
<!-- shows all blog posts regardless of the blog they were posted to -->
<rewrite url="^(.*)/(.*)/posts/(\?(.+))?$" to="$1/$2.aspx$3" name="AllBlogPosts" defaultPage="/Blog.aspx" urlPattern="/{PageName}/posts/{Slug}/" />
<rewrite url="^(.*)/(.*)/posts/(.*)/wlwmanifest.xml(\?(.+))?$" to="$1/wlwmanifest.xml" name="WlwManifest" urlPattern="/wlwmanifest.xml" />


Regards
Ovaj sadržaj još nije ocijenjen. 
15993 Reputacija 2214 Ukupno objava
super

super

18.7.2012. 16:36:41
Thank you khorvat - I will try the code and I just found out that I can also move / add modules dynamically by drag n drop on the homepage which is a great feature. If I add all blog module on the homepage side column, i won't have to touch the code - great feature.
Ovaj sadržaj još nije ocijenjen. 
6018 Reputacija 709 Ukupno objava
khorvat

khorvat

19.7.2012. 6:45:38
Yep, you can instantiate everything dynamically via WebPart and Zones so every module can be dropped to the Zone, I just thought that you want to get  your hands dirty and do some programming :)

Regards
Ovaj sadržaj još nije ocijenjen. 
15993 Reputacija 2214 Ukupno objava
super

super

19.7.2012. 10:45:28
Lol...I will do that in required.

Quick question: Once I re-arrange or add / delete modules via webpart and zones and in future if I upgrade the monoX to the next higher version - will this zone arrange will remain same (means will be saved in database) or i will have to re-arrange everything from starting once again after every upgrade of monoX ?
Ovaj sadržaj još nije ocijenjen. 
6018 Reputacija 709 Ukupno objava
khorvat

khorvat

19.7.2012. 15:34:41
It will be saved in the database so your modules and module settings are safe.

Regards
Ovaj sadržaj još nije ocijenjen. 
15993 Reputacija 2214 Ukupno objava