Following from Tip #1, when you create your custom .dwp. Do as little configuration as possible to the out of the box (OOTB) CQWP before exporting it. I usually just add the OOTB CQWP to a page, then go into its appearance tab to update its web part title to Contoso Content Query or PM Content Query before exporting it. This way, when you add it back into the site collection’s web part gallery it’s as close to the original as possible.
CQWP: 30 Tips #1
I’m speaking March 8 at the 2012 Heartland Region SharePoint Conference (http://iccsharepoint.com). My presentation, titled “CQWP, The Most Powerful Tool You’re Underutilizing.” will be a deep dive into the CQWP covering how to use it and how to customize it. I hope to show why I think CQWP is one of the most powerful tools available to a SharePoint dev.
In honor of the upcoming presentation, I’m going to post 30 CQWP tips. I had this idea a little while ago, but do to the power of procrastination, I now have exactly 30 days until the conference.
If you haven’t registered yet, you can still do so at http://iccsharepoint.com, but seats are filling up fast.
On to the post: 3 xsl files go into creating the CQWP’s layouts. ItemStyle.xsl controls the available item layouts, Header.xsl controls the available group layouts, and ContentQueryMain.xsl acts as the broker that lays down the foundation and calls out to the header and item styles as needed. To customize a CQWP layout, you’ll need to create copies of one or more of these .xsl files and then update a CQWP’s .dwp (.webpart) to reference your copies.
Here’s my typical working scenario. As early as possible, if I identify the need for a CQWP in a site collection, I’ll create copies of the .xsl files. I’ll create the copies side by side with the originals but name them according to the client (Contoso_ItemStyle.xsl, Contoso_Header.xsl, Contoso_ContentQueryMain.xsl). If I have something more specialized, such as a set of styles in mind for use in a project management collection, I may name them something like PM_ItemStyle.xsl, PM_Header.xsl, PM_ContentQueryMain.xsl. Then I’ll create a new .dwp (.webpart) that references the new .xsl files and upload it to the webpart gallery, named something like Contoso CQWP (or PM CQWP).
Tip #1: Although you’re immediate customization need may only require updates to one of the 3 .xsl files. I recommend you ALWAYS copy all 3 and make reference to them in the .dwp. By doing so, you can make changes in the other two as needed later on without having to create a new .dwp. Thus your future changes will be available to your existing CQWPs (as long as you based them on your updated .dwp).
SharePoint’s Limits
From time to time I find myself needing to know what one of the various limits is in SharePoint. Like today when I needed to know how many currency fields I could add to a list. I found this fantastic post on SharePoint Gadget that details about every imaginable limitation: http://sharepointgadget.blogspot.com/2010/05/limits-in-sharepoint-2010.html
Windows 8 Resources
It seems Michael Crump lit it up again this weekend.
First, he made the list of top 10 WinRT people: http://winrtppl.com/ #8, hmm, it must be a randomized list, no way he’s outside the top 5.
Then he released a free eBook: 10 Laps Around Silverlight 5 e-Book available to download for FREE. – Michael Crump.










