Solved

Sharepoint 2010. Webparts on layout that gets data from top level site list.

Posted on 2012-04-11
16
1,284 Views
Last Modified: 2012-04-22
Hi,

 I have a 2010 sharepoint top level site with multiple subsites.   I have some lists on my top level site that contain such as Upcoming Events and News items.  All my layouts use a webpart that display Upcoming Events and some also display news.  This all works fine for pages created in the Top Level site.  If I try to create a page using a layout  with these webparts in a sub site I get an error telling me the list does not exist.

“List does not exist. The page you selected contains a list that does not exist. It may have been deleted by another user. “

I tried editing the website properties to change the URL of the list but that does not work.  I also tried exporting the webpart at the top level site and importing it into the webpart gallery but that does not work either.

I am using the Content Query Webpart. I also have tired displaying a list view as a webpart as well but to no avail.  It seems like this should be part of building a layout. To display common information stored in one central site on layouts.
 
I have access to the site with Sharepoint designer as well.

Can I do this without buying a 3rd party product?

Thank you
0
Comment
Question by:Epistrophy
  • 10
  • 6
16 Comments
 

Author Comment

by:Epistrophy
ID: 37835875
Additional information. The webpart, when placed in a stand alone aspx page in a subiste works fine. It is when the same website is used in a layout, then a page created using the layout, that does not work in a subsite.
0
 
LVL 50

Expert Comment

by:Ingeborg Hawighorst
ID: 37836836
Hello,

Just off the top of my head, because I'm not in front of SharePoint right now:

You say you are using a CQWP. Could you switch to a DVWP instead? DVWPs can easily be integrated into a Page Layout. Initially they will use the current site, but by changing the Select parameters, they can be unlinked and use any source in the site collection.

I have a few DVWPs in my site, one even on the master page. They propagate nicely to sub sites with these settings:

<DataSources>
  <SharePoint:SPDataSource runat="server" DataSourceMode="List" UseInternalName="true" UseServerDataFormat="true" selectcommand="&lt;View&amp;gt;&lt;/View&gt;" id="dataformwebpart1">
    <SelectParameters>
      <WebPartPages:DataFormParameter Name="ListName" ParameterKey="ListName" PropertyName="ParameterValues" DefaultValue="Announcements"/>
      <WebPartPages:DataFormParameter Name="WebURL" ParameterKey="WebURL" PropertyName="ParameterValues" DefaultValue="/TheSourceSite"/>
    </SelectParameters>
  </SharePoint:SPDataSource>
</DataSources>

Open in new window


The key element is this bit:

      <WebPartPages:DataFormParameter Name="WebURL" ParameterKey="WebURL" PropertyName="ParameterValues" DefaultValue="/TheSourceSite"/>

Open in new window


The query source for CQWP is more complex and I've never tried to embed a  CQWP into a Page Layout. I will give it a try when I'm back in front of SharePoint tomorrow.

cheers, teylyn
0
 

Author Comment

by:Epistrophy
ID: 37836995
I will give the DVWP a try this morning and let you know.

Thank you
0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
LVL 50

Expert Comment

by:Ingeborg Hawighorst
ID: 37836999
0
 

Author Comment

by:Epistrophy
ID: 37837924
I get the same problem.  Here is what I did.

1) Created a new layout with one webpart zone
2) Added a DVWP using a list in the top level site. (A simple orgainaztion list and I displayed on the Title)
3) Saved my layout.
4) Successfully created a page using the layout in the top level site.
5) Got an error when I  try to create a page with a layout in a subsite.

Here is the error.

Error
List does not exist.

The page you selected contains a list that does not exist.  It may have been deleted by another user.

Troubleshoot issues with Microsoft SharePoint Foundation.

Correlation ID: 2ac83d35-f55d-41dd-bb30-51535e0493b5

Date and Time: 4/12/2012 9:42:57 AM
0
 

Author Comment

by:Epistrophy
ID: 37838097
Trying a different approach....
0
 
LVL 50

Expert Comment

by:Ingeborg Hawighorst
ID: 37840043
It does not work right out of the box. You need to edit the DVWP code and set the URL, as described in the link above.
0
 

Author Comment

by:Epistrophy
ID: 37840219
In the link example his subsite that had the data was "marc".  Her eis his operative line.

     <WebPartPages:DataFormParameter Name="WebURL" ParameterKey="WebURL" PropertyName="ParameterValues" DefaultValue="/Marc"/>

In my case it is the site collection root on a development server.  

http://isvspwebprod:19023/

so should it be this?

     <WebPartPages:DataFormParameter Name="WebURL" ParameterKey="WebURL" PropertyName="ParameterValues" DefaultValue="http://isvspwebprod:19023/"/>

Is that right?

What about when this is moved to a production server? Will this link then break and all my web parts will have to be edited?

Thanks,
0
 
LVL 50

Expert Comment

by:Ingeborg Hawighorst
ID: 37840250
You should be able to use just the "/" to point to the root site collection
0
 

Author Comment

by:Epistrophy
ID: 37844730
Ok.   I obtained the webID and pasted in the wepart as mentioned above.

I have been trying to get this to work and I keep getting the page creation error. Finally I built a brand new layout and I got the same error. I then deleted my wepart and the webpart zone.  I added back the webpart without the zone and it works!  I then added back the webpart zone and added the webpart again and I get the error.  

Is there a problem using webpart zones in a layout when you are creating pages in subsites?

the webpart zone code itself is very simple.


 <WebPartPages:WebPartZone id="g_B0B12C0D6C4A47BAA1CF7037EE6CA792" runat="server" title="Zone 1">
</WebPartPages:WebPartZone>

I am going to try to build my layouts without zones but I would rather not. I like the webpart zones.

Any ideas?
0
 
LVL 50

Expert Comment

by:Ingeborg Hawighorst
ID: 37845097
If you use web part zones, the user will be able to add/remove web parts from the page, even those that originate in the page layout. If you want to protect the web part from deletion or manipulation, then don't put it in a web part zone.
0
 

Author Comment

by:Epistrophy
ID: 37845140
I want the users to edit the webparts. This will be public facing website. When the staff creates pages, they need to be able to filter and edit the webparts to tailor the page to their needs.

 The public user will of course not have permission to edit the pages

It is a top level site with 7 subsites all using the same master page and css.

I am doing some more testing.   So far the zones are the problem. I create a layout from scratch with a zone and a webpart and can't create a page. Without the zone no problem.  My webpart is n existing xsltListView. I am going to try with just a simple DVWP now.

BTW, I was following this approach.  http://sarpoint.wordpress.com/2011/04/29/sharing-one-list-library-across-multiple-sub-sites/

My layouts do not contain DVWPs so I would rather not switch because it would be a ton of work to do so but I may have to if I can get a layout example to work.
0
 

Author Comment

by:Epistrophy
ID: 37846818
I am stumped.  

I can get a webpart to display list information on a subsite when the list is based on the top level site.  But as soon as I put that same webpart in a webpart zone I get a page creation error.

I know its the webpart zone because I can create a page with a working layout and switch it to the layout with the zone and I get this more specifc error.

"One or more web parts on this page references a zone that doesn't exist. It has been moved..."

I tried changing the title of the webpart zone but that does not do anything.   I have looked in the log file but I am at a loss to what is relevant. I see errors and I see what might be apermission issue, "cannot get user profile, no UserProfile",  but I am not sure it is.  I have full admin rights to sharepoint and the server.  I have attached a cut down version of the log file with just the relevant event info.
 
I am not sure what to do next.
log.txt
0
 

Accepted Solution

by:
Epistrophy earned 0 total points
ID: 37857040
I found the answer in a blog by Chris O'Brien. http://www.sharepointnutsandbolts.com/2007/11/master-pagespage-layouts-deployed-as.html

Here is the operative phrase.

"This is because if web part zones are used, the web part is associated with the page instance rather than the page layout"

Basically webpart zones can't be used in page layouts when you are trying to pull data from another site. Basically sharepoint does not know how to resolve where the list or webpart are because of the  zone. That is why I kept getting "list does not exist" page creation error when I tried to create a page using a page layout with my webpart that got data from the top level site.   It is never going to work.   I hope Microsoft addresses this in the future.

 What I ended up doing was creating a bunch of filtered webparts and page layouts with those webparts embedded int hem without zones. More work but it got it done.
0
 
LVL 50

Expert Comment

by:Ingeborg Hawighorst
ID: 37858325
Thanks for getting back on this. Good detective work and valuable info.

Happy for you to mark your last comment as the solution.

cheers, teylyn
0
 

Author Closing Comment

by:Epistrophy
ID: 37877382
Basically there is no solution to the problem because of a Microsoft SharePoint limitation. Hopefully this will save others the time I spent trying to figure this out.
0

Featured Post

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have just recently built a new SharePoint 2007 farm on a complete Windows 2008 R2 server platform and part of my standard build procedure is to implement a warm up routine, usually in the form of a script that is scheduled every morning to launch …
The Scenario: Let’s say you have a quote worksheet in Excel that you use to work up sales figures and such for your clients. You utilize SharePoint to manage and keep track of these documents. You would like values from your worksheet to populate Sh…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question