Keyvan Nayyeri

God breathing through me

Create an Archive Page for Community Server Blogs

In my new EliteCircle theme, I moved my monthly archive from sidebar to a separate page because as long as my blog is getting older, it's getting longer and can't fit into sidebar easily.

Creating an archive page for Community Server blogs is very easy but it's not included by default.  All you need to do is adding a new Archive.aspx page to your blog theme folder with appropriate content.

First step is to create an empty Archive.aspx file.  Second step is adding your blog master page to this page to keep consistency.  Also you need to add some references to this page and set its title.

Rather than doing above steps manually, I can recommend you to choose one of other pages from your blog theme, remove its content and keep its headers and references.  For example, this is the page header, references and Page_Load method for my EliteCircle archive page:

<%@ Page Language="C#" AutoEventWireup="true" EnableViewState="False"
    MasterPageFile="~/Themes/Blogs/elitecircle/theme.Master"
    Inherits="CommunityServer.Blogs.Controls.CSBlogThemePage" %>
<%@ Import Namespace="CommunityServer.Components" %>
<%@ Import Namespace="CommunityServer.Blogs.Components" %>

<script runat="Server">
    void Page_Load(object sender, EventArgs e)
    {
        SetTitle("Archive");
    }
</script>

Probably you know what the last step is!  Yes, you put an ArchiveDataItemList Chameleon control inside your page ContentPlaceHolder to show archive items.

<asp:Content ContentPlaceHolderID="Main" runat="Server">
    <div>
        <CSBlog:ArchiveDataItemList ID="ArchiveDataItemList1" runat="Server">
            <LeaderTemplate>
                <h1>
                Archive</h1>
            </LeaderTemplate>
        </CSBlog:ArchiveDataItemList>
    </div>
</asp:Content>

And now, you have an archive page!

3 Comments

jayson knight
May 17, 2007 3:04 AM
#
great tip! I've been doing something similar to this for both my archive and link lists for a while now...keeps the main blog page clutter free.

External Feeds
May 18, 2007 8:55 PM
#
blog bits Bill Bosacker will soon feel the love of being Community Server Calendar Control Man, with

External Feeds
May 18, 2007 11:20 PM
#
Keyvan describes how to create an archive page. I don't see much value in the archive display-by

Leave a Comment





Ads Powered by Lake Quincy Media Network