Content Query Web Part not displaying without web part zone
I am building a Sharepoint WCM site for a client.
As part of a page layout I inserted a content query web part directly in the page, not in a web part zone (so the users couldn't edit it). Everything works fine in my development environment however when I deployed it to production the web part would say 'no items returned'.
When I went into the feature directory and changed the page layout to include the webpart zone wrapper it fixed the problem howev开发者_StackOverflow社区er I don't really want it to have a web part zone. My development environment is Windows 2003 however the production site is Windows 2008.
Can anyone explain why it may not be working?
ThanksA quick idea is that you can right-click the WebPart Zone in SharePoint Designer and uncheck the options that allow the users to manipulate it.
You will have a webpart in the page just as 'locked' as if it was outside the WP Zone.
Edit
Parameters in the WebPartPages:WebPartZone tag:
allowlayoutchange="false"
allowpersonalization="false"
allowcustomization="false"
This might not be what your issue is, but keep in mind that if you embed the CQWP directly in the PageLayout, it doesn't have access to SPContext.Current (i.e. the web part doesn't know where it is in the site hierarchy), so it will default to returning everything in the Site Collection. (That being the case, it would seem like it would return everything and not nothing.) Here's a post explaining a work-around, if this is indeed related to your issue:
http://suguk.org/blogs/sharepointhack/archive/2008/09/17/13785.aspx
精彩评论