SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Hi I am adding a content query web part in one of my sites and in query property I am setting the required content type and its related property but I want to display the fields in the site from content query web part.i want to show all the columns of content type in the site when I add content query web part.can anyone provide some examples or links related to this,.Thanks.

share|improve this question
up vote 0 down vote accepted

You'll need to export the webpart, and add all the fields you want, then upload the webpart again to the webpart gallery.

Here is a step by step on how to do it:

share|improve this answer
Hi Mohamed Derhalli the link you provided helped me lot.I have completed the CQWP way i need.Thanks to all. – user2314241 Aug 29 '13 at 13:06

Mohamed Derhalli is correct if you're asking how to place a preconfigured CQWP on a page. (place on page, configure it, export/import).

But if you're asking about ways to get all the columns data, I believe your CT will have to be attached to a list and then data added to the list. Then configure the CQWP to read from the list with the CT and your slots will appear with your columns.

To modify the presentation of the data, you'll have to write XSL in a custom itemStyle.xsl (copy the original and link it in the .webpart file).

share|improve this answer

With 2010 you no longer need to export the web part to define what fields to include - you can do this via the slots when you edit the web part properties. However, Josey is correct that as none of the standard styles will display all your columns you will need to create a custom ItemStyle.

I have a couple of blog posts specifically on CQWPs and others on general XSL which will hopefully explain what is needed.

share|improve this answer
HI all thanks for your response i have cretaed own xsl but how do i attach it to the webaprt now i am bit confused please guide me with your suggestions.Thanks – user2314241 Aug 26 '13 at 13:55
You need to tell the CQWP to use your XSL stylesheet. Easiest way to do this is to right click on it in SPD and select Properties. These will appear on the right hand side. Towards the bottom are properties for main, items and header. It is the ItemStyle one you will need to replace. This is explained in the blog link above. – Dave Paylor Aug 26 '13 at 20:09

@Josey, If you add the content type to a list, and then configure the Content Query WebPart to read from this list, you won't have any advantage this way unless as I said in my previous answer, you need to export the webpart and make it "aware" of these new columns, then upload it again, it's something that you need to do in the same webpart's code, not outside it like in the content type or the list.

share|improve this answer
How to get the location or path of the file in cqwp using custom xslt modification. Thanks in advance. – user2314241 Apr 21 '14 at 20:23

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.