Subclassing the Content Query Web Part: Adding Dynamic Filtering

 

The Content Query Web Part (CQWP) is an absolutely killer for MOSS 2007 Publishing sites. It is one of the best performing rollup Web Parts available to developers and should always be considered before rolling your own solution. You can even do some really sick customization to the presentation of the results produced by the CQWP as shown in this post on the ECM team blog by George Parantatos, a PM on the product team:

» ECM Team Blog: Configuring & Customizing the CQWP

However there are two things I always hear about the CQWP in terms of wish list type stuff:

  1. It doesn’t contain any built-in paging mechanism… yeah, I too wish for this.
  2. It doesn’t support dynamic filtering. For instance, I have to manually specify the filtering values rather than have them be dynamically set.

Before you rush off and roll your own, stop, get a cup of coffee, and saddle up next to your laptop. With just a few lines of code you can utilize the provided CQWP but add your own customizations. Take the second pain point: no dynamic filtering. Let’s say you have a slew of content and you want to dynamically set the filtering values, say for example, using values on the query string.

Subclassing the Content Query Web Part: Adding Dynamic Filtering

Random Posts

Loading…

Leave a Reply