Quantcast
Channel: SharePoint 2010 - Development and Programming forum
Viewing all articles
Browse latest Browse all 11508

customizing CQWP in custom page layout

$
0
0
This is a followup question of this thread which was resolved successfully- 

http://social.technet.microsoft.com/Forums/en-US/04f806b6-e65b-4980-9b97-d2f481b0bf18/customize-content-query-web-part-in-custom-page-layout

Let me restate the issue- 
I have a CQWP embedded in a custom page layout which points to the OOTB Contacts list. The requirement is that the CQWP should pull from the Contacts list that is local to the site. But when a CQWP is added to the page layout in sharepoint designer it always points to the Contacts list that is in the root site of the sitecollection.
The resolution to the above was to open the page layout in sharepoint designer, go into the code view and then set the ListGuid property to null and webUrl property to ~site
The above resolution worked for me but please read on to know about the issue that this thread is about.

When I took the modified page layout (in which ListGuid was set to null and WebUrl set to ~site) and made that part of a package which I deployed to another environment I found that the CQWP was not working properly.
The CQWP was not referencing the itemstyle.xsl in the other environment as it should so it was not getting displayed properly.
In order to fix it, I had to open the page layout in the new environment using sharepoint designer. Then I right- click the CQWP and click OK which would reset the ListGuid and WebUrl to their original values. Then I would in code view reset the ListGuid to null and WebUrl to ~site and save the page layout. 
After this every thing would work correctly. We have to give this package to external party and we cannot tell them to make these silly tweaks in sharepoint designer after the package gets deployed.

So has anybody come across this before and can someone give some suggestions? Thanks in advance.

Viewing all articles
Browse latest Browse all 11508

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>