How to specify a own xsl to content query web part placed on a page layout
Hi All,I am trying to change presentation of a content query web part that I have inserted onto a page layout,NOT a page.<PublishingWebControls:ContentByQueryWebPart runat="server" FilterField1="{d81529e8-384c-4ca6-9c43-c86a256e6a44}"...<Xsl><xsl:stylesheet xmlns:x="http://www.w3.org/2001/XMLSchema" version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:cmswrt="http://schemas.microsoft.com/WebPart/v3/Publishing/runtime" exclude-result-prefixes="xsl cmswrt x" > <xsl:import href="/Style Library/XSL Style Sheets/Header.xsl" /> <xsl:import href="/Style Library/XSL Style Sheets/ItemStyle.xsl" /> <xsl:import href="/Style Library/XSL Style Sheets/myContentQueryMain.xsl" /> </xsl:stylesheet></Xsl>...</PublishingWebControls:ContentByQueryWebPart>This is the part from the layout. As you see, Ispecify myContentQueryMain.xsl rather than the original ContentQueryMain.xsl.However, it seems to me that it is not used.It is a copy of the original ContentQueryMain.xsl. I modified. Nothing happened.A page created based on the layout stillcomes withthe default presentation.So after all, I even removed the myContentQueryMain.xsl. The same...Do I miss something?Yourhint, insight etcwould be very much appreciated.Thanks,Kazu
April 2nd, 2009 6:53pm

Moving to Admin.WSS FAQ sites: WSS 2.0: http://wssv2faq.mindsharp.com WSS 3.0 and MOSS 2007: http://wssv3faq.mindsharp.com Total list of WSS 3.0 and MOSS 2007 Books (including foreign language titles) http://wssv3faq.mindsharp.com/Lists/v3%20WSS%20FAQ/V%20Books.aspx
Free Windows Admin Tool Kit Click here and download it now
April 2nd, 2009 7:03pm

Hi, If you want to use a custom ContentQueryMain.xsl in a content query web part, you should first to make a copy of the ContentQueryMain.xsl file in SharePoint Designer, and then export the content query web part to a ".webpart" file, open the file in SPD, and look for the line that beings with <property name="MainXslLink" You will have to replace this line with the following code, replacing "myContentQueryMain.xsl " with the name of your own file. This blogs has detailed steps: http://www.thesug.org/blogs/kyles/Lists/Posts/Post.aspx?ID=3 Hope it can help you.Xue-Mei Chang
April 7th, 2009 8:31am

Thanks, Xue-Mei.I managed to figure it out myself.When youhave CQWP placed on apage layout rather than a page,you do not have to go thru all this export, modify the .webpart and then upload etc. You just specify the XSL as follows.<PublishingWebControls:ContentByQueryWebPart MainXslLink="/Style Library/XSL Style Sheets/myContentQueryMain.xsl" >That seems to be it.
Free Windows Admin Tool Kit Click here and download it now
April 8th, 2009 12:51pm

Thanks bud.. you saved a ton of time for me .....Cheers -mnc2mnc
May 25th, 2011 4:16pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics