Tuesday, September 24, 2013

Content Query web part --Querying multiple specific lists

Hi guys,

How to query the data from multiple lists in SharePoint using content query webpart?

 I have a simple requirement to display the latest 5 document links from multiple document libraries in the current site.

 In general, share point out of the box feature provides the way to query the data from a particular list or all the lists/document libraries in a site or entire site collection.

 If you want to query the data from multiple specific lists, you have to do in in the below way.

 Add the content query webpart to the page,by editing the page and it comes in Content Roll up category. Note- if you are not able to see content query webpart in content roll up category, then your site's publishing feature is not activated. Activate that feature at the site collection level and also at the site level [make sure you have site collection administrator rights.]

 In the content query web part tool box section, select the radio button, that shows "select all the lists/document libraries in the site" and do the remaining filter and sort options, presentation things as per your requirement.

 Finally click Apply button ,then save the page and do the export web part.

 Open the .webpart file after you export it, modify the .webpart file in designer and then find the below property "ListsOverride ".

Get the List GUIDs from the list settings page, for which you want to query the lists.

 Modify that tag similar to the below one.









No comments: