ArchiveControl workaround - per popular demand

ArchiveControl workaround - per popular demand

Posted on May 12, 2008 0 Comments

The content you're reading is getting on in years
This post is on the older side and its content may be out of date.
Be sure to visit our blogs homepage for our latest news, updates and information.

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…

progress-logo

The Progress Team

View all posts from The Progress Team on the Progress blog. Connect with us about all things application development and deployment, data integration and digital business.

Comments

Comments are disabled in preview mode.
Topics

Sitefinity Training and Certification Now Available.

Let our experts teach you how to use Sitefinity's best-in-class features to deliver compelling digital experiences.

Learn More
Latest Stories
in Your Inbox

Subscribe to get all the news, info and tutorials you need to build better business apps and sites

Loading animation