Friday, May 27, 2011

Content Query WebPart (CQWP) in SharePoint 2010

Content Query WebPart comes first in MOSS 2007, but in SharePoint 2010 there are some new features introduced.Content Query Web Part (CQWP) is used to show information from sites in the current site collection by querying, filtering, and sorting the content. Also CQWP you can show information from list as well as from publishing pages. But to use CQWP publishing features need to be enabled.

To add a content Query Web Part (CQWP) Click on Edit Page -> From Editing Tools Select Insert -> Web Part -> Select Content Roolup Categories and then Select Content Query WebPart.
Once you add the content Query Web Part you can click on open the tool pane to configure the web part. When you click on this link the Content Query window will open as shown figure below.



From the Query section you can select to show items from all site in the current site collection or can browse the particular site or subsite or we can select the list as shown below figure.

In the Presentation tab you can Sort items, Give Styles as shown below fig. You can directly select which fields you want to display rather writing any XSLT for this purpose.

There is one new token  [PageQueryString:PARAMETERNAME] is available to handle Query String parameters. You can use this token in the Additional filers section where you can also filter on different conditions. You can see the pics below:

Also in SharePoint 2010 there is another token available: PageFieldValue which is used to filter that matches the value of another field on the same page only. [PageFieldValue:FIELDNAME] is the syntax to use this token.

Please let me know anything I am wrong !!! You can also check XSLT list view web part in SharePoint 2010.

3 comments:

  1. Thanks !!! Keep reading http://www.enjoysharepoint.com

    ReplyDelete
  2. Simple Post, and easy to understand of CQWB. Thanks, Krishna Adari

    ReplyDelete