11
Jul
10

Running the Content Query Web Part (CQWP) on a Team Site Without the Publishing Infrastructure Feature Enabled in SharePoint 2010

I was doing a little monkeying around (read that "book editing") with SharePoint 2010 and decided to see if the similar post I read by Sameer Dhoot was still true in 2010.  If you are missing the CQWP in SharePoint, you’ll find that activating the Publishing Infrastructure feature will fix the problem, as the CQWP is added/enabled as part of the Publishing Infrastructure.  Well, what if you want to use it in a team site for some reason?  Turns out you can still do it.

If you simply export the CQWP from the web part gallery of your publishing site and import it to the web part gallery on your collaboration site, you won’t run into any problems.

image

You can export the web part by clicking the Edit icon and selecting the Export function in the ribbon.

image

The problems will start to occur when you try and use it.  You’ll get errors when your page on which you’ve added the CQWP attempts to render the web part.

image

In this version of SharePoint, there is a Style Library in both collaboration and publishing sites.  The important difference is that the collaboration site Style Library is empty.  This is where the problem resides.  You can either copy the content out of the publishing site style library or, you can create a list template out of the publishing style library and save the content with the template. 

Since the publishing site does not have a "Save document library as template" link, you’ll have to create one on your own.  Navigate to the library settings on your Shared Documents library and select the "Save document library as template" link.  You’ll notice that this is using the _layouts/savetmpl.aspx page and it is passing the List GUID as a parameter  (/_layouts/savetmpl.aspx?List=%7B1C534D30%2D9F2F%2D41A5%2DAC98%2D51CD244F532D%7D).

image

Navigate to the publishing site’s Style Library settings page (_layouts/listedit.aspx).  Now simply change the listedit.aspx to savetmpl.aspx and press enter.  Fill out the form being sure to "Include Content" and save it.

image

You should get a successful save.  Now navigate to the list template gallery.

image

Right-click and save the list template (STP) on your computer. 

image

Now all you need do is navigate to your site template gallery on your collaboration site and upload the STP file.  Then you can delete the existing Style Library and create a new list called Style Library from the template. 

image

You should now feel the love the the CQWP in your collaboration site.

image

Further investigation shows that the CQWP needs these three style sheets in order to function correctly:  ContentQueryMain, Header and ItemStyle.  Removing any of these from the Style Library will cause the CQWP to throw an error.  So, you could probably just export these styles and import them into your collaboration site’s Style Library and accomplish the same thing.

image

Advertisements

3 Responses to “Running the Content Query Web Part (CQWP) on a Team Site Without the Publishing Infrastructure Feature Enabled in SharePoint 2010”


  1. 1 Andy
    July 25, 2011 at 10:13 am

    Didn’t work using just those 3 files mentioned, worked after I saved the entire library and moved it over though.

    Cheers!

  2. 2 Antonio
    October 18, 2011 at 8:17 am

    Excellent post! I just did not want to enable the publishing feature for collaboration sites. I am glad I found this post. Good job!


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


Asif Rehmani’s SharePoint Videos

SharePoint-Videos

Click to access a wealth of SharePoint videos

SharePoint Rx

SharePoint Rx Home

Categories

Posts by Date

July 2010
M T W T F S S
« Jun   Sep »
 1234
567891011
12131415161718
19202122232425
262728293031  
Support Wikipedia

%d bloggers like this: