The Content Query Web Part (CQWP) allows you to display data from a list anywhere within a Site Collection, and it works very well to only display the data targeted for a SharePoint group when Target Audiences are enabled for rows of data in that list. However, by default the CQWP only displays the freaking ‘Title’ of the row of data, if you want to display all the other columns in the list you have to do these modifications described in the 7 steps below. Tidbits/Fun Facts/Caveats:
- The CQWP is only available with MOSS 2007, not with WSS 3.0!!
- The CQWP cannot pull data from a Lookup field that allows multiple values. If you uncheck the ‘allow multiple values’ box then it works, but only 1 value of course.
- Column Types: I copied this list:
Display Column Type |
Internal Column Type |
Single line of text |
Text |
Multiple lines of text |
Note |
Choice |
Choice |
Number |
Number |
Currency |
Currency |
Date and Time |
DateTime |
Lookup |
Lookup |
Yes/No |
Boolean |
Person or Group |
User |
Hyperlink or Picture |
URL |
Calculated |
Calculated |
<td><xsl:value-of select=”@Department_x005F_x0020_Code” /></td>.
- Adding the Content Query Web Part to a Web page on an Office SharePoint Server 2007 site.
- Configuring the Content Query Web Part to work with the Project Status Reports document library and the Project Status Report content type.
- Exporting the Content Query Web Part to a .webpart file.
- Editing the exported .webpart file and setting the CommonViewFields custom property of the Content Query Web Part to request the Project Status Report content type custom fields.
- Editing the default XSLT transformation, which is used by the Content Query Web Part to display the Project Status Report content type custom fields.
- Importing the edited .webpart file to a Web page on an Office SharePoint Server 2007 site.
- Configuring the imported Web Part to use the new XSL style.