HowTo: Display Custom Fields in CQWP

Over at MSDN, the team has demonstrated a howto for displaying custom fields in Content Query Web Parts.

This how-to article shows the steps for modifying the properties in the Content Query Web Part .webpart file so that the Web Part displays content type custom columns from a document library.

You can use the Content Query Web Part to display a dynamic set of items based on a query. The Content Query Web Part enables you to set presentation options that determine how items are displayed on the finished page. The items displayed by the Content Query Web Part always reflect the most current set of items retrieved by the query that the page viewer is authorized to see. The query is run whenever the page that contains the Content Query Web Part is viewed. If new content is added and it meets the query criteria, the Content Query Web Part automatically displays it. By default, the Content Query Web Part does not return all fields for items returned in a query. This visual how-to article demonstrates how to display custom fields in the Content Query Web Part by setting the CommonViewFields custom property and editing the default XSLT transformation used to render items. The steps include:

  1. Adding the Content Query Web Part to a Web page on an Office SharePoint Server 2007 site.

  2. Configuring the Content Query Web Part to work with the Project Status Reports document library and the Project Status Report content type.

  3. Exporting the Content Query Web Part to a .webpart file.

  4. 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.

  5. Editing the default XSLT transformation used by the Content Query Web Part to display the Project Status Report content type custom fields.

  6. Importing the edited .webpart file to a Web page on an Office SharePoint Server 2007 site.

  7. Configuring the imported Web Part to use the new XSL style.

For complete howto, visit here | Video of this howto

Friday Video: Enable Excel Services in SharePoint 2007

Friday Video: Email enable SharePoint List