Problem:
I want to deploy my custom style for the Content Query Web Part (CQWP).
The CQWP is using the following files to style its presentation: ContentQueryMain.xsl, Header.xsl and ItemStyle.xsl. The files are located under /Style Library/XSL Style Sheets in the root site.
The first solution that comes into my mind is to replace the OOTB xslt files with our customized files. It will work if you do it as a manual operation from the Sharepoint UI but it will not work from the site definition (onet.xml) or from a feature. Also this solution doesn’t provide you an independent solution that doesn’t interfere with Microsoft possible updates.
Solution:
ContentByQueryWebPart is the CQWP class (a public class). It has a constructor with 3 parameters that provides a hook to specify the relative URLs to the files used for styling. You have to create a light class that inherits from ContentByQueryWebPart and which has the following implementation for the default constructor:
public class MyCustomContentQueryWebPart : ContentByQueryWebPart
{
public MyCustomContentQueryWebPart()
: base(”/Style Library/XSL Style Sheets/MyCustomContentQueryMain.xsl”, “/Style Library/XSL Style Sheets/MyCustomHeader.xsl”, “/Style Library/XSL Style Sheets/MyCustomItemStyle.xsl”)
{
}
}
MyCustomContentQueryMain.xsl, MyCustomHeader.xsl and MyCustomItem.xsl can be created copying the OOTB files and amending them. The xslt files can be deployed to the /Style Library/XSL Style Sheets directly from the onet.xm file if you have your custom site definition or using a feature.


If you only have a strategy for the trending cycle, you’re only trading thirty percent of the time. If you have a breakout strategy along with a trending strategy that only increases your trading time to forty percent. That means if you only incorporate those two market cycle strategies into your forex system, you will be sitting on the trading sidelines sixty percent of the time.
Thanks for the sharing really usefull. I would like to bookmark this site.
Nice site, I just dugg this keep up the good work!. . . . . .
Good information, keep working man. I like your website. Cheers~~~~
Its very informative and interesting article.all the points are very useful. Simple but very effective writing. Thanks for sharing such a nice post.
Thanks for taking the time to discuss this, I feel strongly about it and love reading more on this topic. If possible, as you gain expertise, would you mind updating your blog with more information? It is extremely helpful for me.
I was just browsing for relevant blog posts for my project research and I happened to stumble upon yours. Thanks for the useful information!
Should there be another persuasive post you can share next time, I’ll be surely waiting for it.
google people search
android google voice search
I am really thankful to the author of this post for making this lovely and informative article live here for us. We really appreciate ur effort. Keep up the good work. . . .
I really love going back to your site to read your story and see more pictures that are really taken with great care. . . . . .
Hold yourself responsible for a higher standard than anyone else expects of you. Never excuse yourself. Thank You. . . .
Greetings! I linked to your articles on the other hand I do not get a trackback. Can you enlighten me what is actually taking place?
Aw, this was a really quality post. In theory I’d like to write like this too – taking time and real effort to make a good article… but what can I say… I procrastinate alot and never seem to get something done.
Hello there! Our organization are needing for possible essayissts, should you be attracted? It isn’t going to cause you wealthy on the other hand there is an engaging pay and if you definitely cherish publishing then this process opportunity is for you.
Could you be interested over a website link trading? Generously post me a communication.
Educational and entertaining. I’ve additional your internet log to my “reading substance. ” Progress me updated!. . . .
Thanks for good article. Hope to see more soon. . . . .
wow, great, I was wondering how to cure acne naturally. and found your site by google, learned a lot, now i’m a bit clear. I’ve bookmark your site and also add rss. keep us updated.
I thought it was going to be some boring old post, but it really compensated for my time. I will post a link to this page on my blog. I am sure my visitors will find that very useful. . . .
Amazing, truly excellent information. Your blog is really awesome. I bookmarked this and will come back once again. . . .
I trust you and yes it definitely likely to help many people.
Amazing stuff,Thanks so much for this!That is very helpful post for me. This will absolutely going to guide me in my projects .
Thanks for taking the time to share this, I feel strongly about it and love reading more on this topic. If possible, as you gain knowledge, would you mind updating your blog with more information? It is extremely helpful for me.
Easily, the article is actually the best topic on this registry related issue. I fit in with your conclusions and will eagerly look forward to your next updates. Just saying thanks will not just be sufficient, for the fantasti c lucidity in your writing. I will instantly grab your rss feed to stay informed of any updates.
Nice web log, would of created the web log bit longer, enjoyed reading it though.
I was just browsing for relevant blog posts for my project research and I happened to stumble upon yours. Thanks for the useful information!
Substantially, the post is actually the sweetest topic on curing acne naturally. I concur with your conclusions and will thirstily look forward to your future updates. Just saying thanks will not just be sufficient, for the tremendous lucidity in your writing. I will right away grab your rss feed to stay abreast of any updates.