Two articles regarding customization of the Content Query Web Part's XSL are often referenced by SharePoint 2007 blogs: one by Microsoft's Enterprise Content Management team and the other by Microsoft Luxemburg's Steven Van de Craen.  These two articles assume that the user has access to the ItemStyle.xsl file, located in SharePoints "/Style Library/Xsl Style Sheets" directory.  Users of shared server environments may not have write access to this file - or may simply not want to modify a shared copy. 

The work around for this issue is simple.  Fortunately, the Content Query Web Part exposes a property for overriding the default XSL style sheet used to transform/render the content and, as such, this property can be customized in the exported Web Part Definition (*.webpart) referenced by Steven's article to add custom fields.  In addition to defining any additional fields you may want, point the ItemXslLink node in the exported file to a customized version of the ItemStyle.xsl file; in our case, we placed this in a document library on the client's SharePoint site.

One downside of this approach is that it requires the user to import a Web Part Definition file in order to use the style (assuming the developer doesn't have access to the WP directory).  Also, the XSL style sheet is limited to handling named styles already defined in SharePoint; the CQWP will not enumerate the custom XSL file for new styles.

Saturday, April 14, 2007 3:34 PM
Filed Under [ SharePoint, ]

Comments

No comments posted yet.

Post Comment






 

Please add 3 and 2 and type the answer here:
*