0

I have a list on a root site (SP 2010). I want to create a list view webpart on a subsite that is connected to the list on the root site.

All the guides I have read online say to go into the listview on the root site and export the webpart (as either a file or to gallery - I have been trying both of these options). When I then import this webpart onto a page on a subsite I immediately get an error:

Error

An unexpected error has occurred.

Web Parts Maintenance Page: If you have permission, you can use this page to temporarily close Web Parts or remove personal settings. For more information, contact your site administrator.

The page is then inaccessible, to fix this I have to roll back to the previous version or use the web parts maintenance page to delete the webpart I have imported.

What is it that it causing me grief, whereas all the info online where everyone else follows these steps it seems to work fine?

2
  • I have found some additional info on this problem. Seems to do with the list on the root site having the 'Allow management of content types' set to Yes. I changed it to No, then exported the webpart. When importing it to a new page it worked fine.
    – AndyFlems
    Commented Mar 25, 2014 at 13:45
  • I switched the root list option back to Yes and imported it onto another subsite page and the "An unexpected error" issue happened again. Seems as though i can only import this to a subsite page when this option is set to no (although i can change it back to yes once imported). Does anyone know why?
    – AndyFlems
    Commented Mar 25, 2014 at 13:47

2 Answers 2

1

Perhaps you've seen this, but it works for me. Beware the gotchas at the bottom.

Go to the site that has the list view you want. Add a content editor webpart with the following:

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$('div[allowExport="false"]').attr("allowExport","true");
});
</script>

Now you can export the webpart you want.

Next, open the .webpart file in notepad and look for

<property name="WebId" …>all_zeros_guid_here</property>

Replace the zeros with the GUID of the site the list is on. You can get it by going to _layouts/sitemanager.aspx When you hover over a site in the right pane, the GUID is displayed at the bottom left of the window. ScreenCapture it and type it in.

Save and upload webpart

Thanks to: http://techtrainingnotes.blogspot.com/2009/03/sharepoint-one-library-multiple-sites.html

Gotchas apply and include:

Only within site collection; Not tested with all list/lib; Will error while you allow editing of content type on target list

1

Thanks for the reply. It was much appreciated.

However, instead of going for the workaround, I have simply turned off "Allow content type management" on the root site list, then exported webpart to gallery and imported it onto the subsites. Once I had completed all of the imports I switch content type management setting back on at the root site. All works fine.

Just posting in case anyone else gets stuck on this issue. I'm not sure why Sharepoint has a problem with exporting/importing Listview webparts between root/subsites when this setting is activated, but it can be temporarily deactivated as a solution.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.