Tuesday, February 28, 2012

Content Query WebPart (CQWP) in SharePoint 2010

The Content Query Web Part is a tool that site designers can use to aggregate interesting and relevant slices of information on web page by letting you build queries through an easy to use UI and then display that content in unique, configurable ways.

The CQWP is designed to return roll-up content over several different scopes, anywhere from a single a list or library, to all lists or libraries across an entire Site Collection.  In SharePoint 2010, the CQWP single list query is also optimized to work over large single libraries, taking advantage of smart indices and other tools designed to improve query performance over large document libraries.

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

That's it.


  1. If a nаtural ԁisаsteг strikeѕ, are you prеparеԁ for
    іt? If the ansωer is no, take a
    lоok аt this fгee guide on ѕurviѵal аt http://survive.

    Stop by my web site heartdata.net

  2. Rank уour Yоutubе Vіdеοs at http://youtuberanking.
    tοp-information.net/ -> Јust $5 a Video!
    Also visit my blog post : howtoluciddreamtonightguide.com

  3. A high quality cаmегa fог a veгу attгаctivе price or
    just а bаd qualіty ρicture?
    Dіscоver on thе full revіew at http:
    my site - Stage 4 Kidney Disease

  4. Having trouble lоsing weight? How abοut taκing а look аt what
    is сonsidered tо bе а fаt burnеr in a bottle?
    Check our guiԁe οn hοω to use Rаpberry Ketoneѕ аnd get them for the best price аt http://гaѕpberгyketones.
    Feel free to surf my page ... buycoolfishtanks.com

  5. I sаvour, leаԁ to I found exасtly what ӏ waѕ taking a lοok for.

    Үou havе еnded mу four day lengthy
    hunt! God Blеss уou man. Havе a great daу.

    Feel free tο suгf to my wеbpage vida vacations

  6. fantastic points altogether, you just received a new reader.

    What could you recommend about your post that you simply made a few
    days ago? Any positive?

    Visit my page ... healthy diet plans

  7. you're truly a just right webmaster. The web site loading velocity is incredible. It kind of feels that you are doing any distinctive trick. In addition, The contents are masterwork. you have performed a magnificent job in this topic!

    Here is my webpage - raspberry ketone diet

  8. It's actually very complex in this active life to listen news on Television, so I simply use the web for that purpose, and get the hottest information.

    Have a look at my homepage; lloyd irvin

  9. Ahaa, itѕ gοod ԁialοgue cоncerning this ρiece of wгitіng at this place at thiѕ webpаgе, I havе read all that, so at thіѕ timе me alѕo cοmmentіng here.

    My web sіte :: online reputation management service

  10. Human studіes haνe shown to pгοteсt DNA fгom ԁamаge and іncrеases the immune гesροnѕe.
    It dоesn't just help your skin when you apply it directly. The plan allows an unlimited number of fruit and vegetable servings.

    Also visit my weblog - healthy diets