SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

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

Is there a simple way to package a CQWP with its required XSL and CSS ( and maybe js) files as a feature?

The scenario I have is that i have some components in a WCM page that are implemented as OOTB CQWP with custom XSL. I have the .webpart file and the XSL files. Can I have these packaged as a feature so that by activating this feature, I get a new web part in the gallery that is already pointing to a list and has the appropriate styles?

I am using SP2010.

share|improve this question
up vote 2 down vote accepted

The easiest way to do this in Visual Studio 2010 is to create a new Module (right click project -> Add New Item -> Module), and place your required files into this Module folder (just drag them in from Explorer).

In the Elements.xml for the Module, you can define which files you want placed where in the site. The Path element points to the location in your project, and the Url element points to where you want the file to end up.

share|improve this answer

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.