ArchiveControl workaround - per popular demand

May 12, 2008 Digital Experience

We’ve had archive control as a Sitefinity built in control for a brief time, however there were some performance issues with it, so we took it out - until we get time to rebuild it.

We’ve got quite a few complaints about removing that control and most of the people told us the old control worked just fine for them. So, I’ve created a new ArchiveControl for blogs and will publish it in this post, together with the source.

The basic idea

To have archive functionality on our site, we obviously need an archive control. However, we are also going to need a modified BlogPosts control that will know how to show only the posts for a particular month and year. So, for this workaround I have created two custom controls:

ArchiveListControl – this control will display the list of month/year pairs together with the number of posts published in that month.

BlogPostsArchiveSupport – custom control that inherits BlogPosts control and overrides CreateFilter function so that it can recognize and correctly implement query string passed by ArchiveListControl.

Both controls are very simple and I have commented the more important parts, so I won’t go into too much details. Depending on the version you are working with, you may need to rebuild the controls with correct references (I was working on 3.2 SP 1 version).

Anyhow, the compiled controls together with the source you can download from here.

Let me know if you have any questions.

p.s. with very little work you can extend of modify these controls to support Events archive, News archive and so on…

The Progress Team