Tuesday, 18 November 2008

Getting Mirrored Blog Items to show in a AggregatePostList control : Community Server 2.1 SP3

The control declaration:

<Blog:AggregatePostList
                runat="Server"
                PageSize="5"
                id="AggregatePostList1"
                IncludeAutodiscovery="true"
                IncludeCategories="true"
                ScorePosts="true"
                ApplicationKey="News"
                MirrorDisplayType="AllBlogs"
                EnablePaging="false"
                EnableTitle="false">
              <SkinTemplate>
                <h2 class="CommonTitle">
                  <asp:Literal runat="server" id="title" Visible="false" />
                  News
                </h2>
                <Blog:AggregateList id="Posts" runat="Server" EnableTitle="false"/>
              </SkinTemplate>
            </Blog:AggregatePostList>

NOTE: ApplicationKey needs to be set to the blog name.  Each mirrored blog needs the "Aggregate in site blog roll" checkbox checked so that it appears in the aggregate control, as above.  Changing this flag after the blogs have been mirrored will not make a difference, retrospectively.

To configure existent posts to appear in the Community Aggregate, just run

update cs_posts
set PostConfiguration = 55 where SectionID = XXXX

Where the section id is the id of the blog. Look in select * from cs_sections where name = 'blog name' for the section id.