Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I'm working in SharePoint 2010 Server and creating custom content query web parts (CQWP) that point to custom ItemStyle_myTemplates.xsl file. To do this, I've been creating the CQWP in the browser by adding a default CQWP and changing the Query piece. Then I export the CQWP to file on my local machine, edit various settings (add custom columns to CommonViewFields, etc.) and import back into SharePoint.

However, during the import, it appears under the Imported folder; it doesn't become part of the web part gallery. I then test it, export, import again. Is there a better way of doing this? How do you upload a CQWP to make it part of the web part gallery? Is it possible to do any of this in Designer? It won't let me open the publishing page that contains the CQWP, giving the message: This page cannot be edited in SharePoint Designer. You can edit the content in the browser, or edit the corresponding page layout in SharePoint Designer.

Your help is appreciated. Thanks.

share|improve this question

1 Answer 1

up vote 4 down vote accepted

To add your configured web part to the web part gallery, go to Site Settings and then to the web part gallery. You can then upload your .webpart file - the gallery behaves like a normal document library.

This is fine for one-off or occasional use. To do this in a repeatable way you would need to develop a feature, to deploy the webpart definition to the gallery, in Visual Studio, for that professional touch.

You can't open a publishing page in SharePoint Designer because it isn't really a page as such, just a list item. You can edit the associated page layout in SPD. If you want to edit the page content you need to do it in the browser.

share|improve this answer
    
Thanks, SPDoctor. Your answer about the publishing page makes sense now -- duh! How do you do the webpart definition in Visual Studio? –  Alex C Aug 15 '11 at 11:01
3  
You need to create a feature that deploys your .webpart file to the gallery (_catalogs/wp) using a Module. –  SPDoctor Aug 15 '11 at 11:14

Your Answer

 
discard

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.