Besides buying a third party, what is the best approach to extending the CQWP control to include content from a seperate site collection?
SharePoint Cross Site Content Query Web Part
3k views Asked by Shane Jordan At
2
Besides buying a third party, what is the best approach to extending the CQWP control to include content from a seperate site collection?
You can not override the content query webpart to query another site collection. It uses the SPSiteDataQuery http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spsitedataquery.aspx , this is limited to the current site collection. But you could create a custom webpart that has similar function but looks to a site collection by url rather than from the SPContext. Example:
using (SPSite site = new SPSite("http://server/")) { // build a SPSiteDataQuery // include the CAML query // use the datatable of results to create XML // use XSLT to transform XML into HTML }