3/15/2009

SharePoint: One library, multiple sites!

Update:

I finally got around to testing this in SharePoint 2010, and it works!  Every once and a while I got an error message when saving the page after adding the web part, but it was random and I could not duplicate it. If you try this in 2010, then please add a comment to this article and share if it worked or not.

 

Article summary:

  • I will show how to create a custom web part that represents a list or library’s view and use this web part in other sites (at least in the same site collection) without copying documents between sites.
  • This custom web part supports a tool bar so files can be uploaded and maintained in a single library, but viewed and maintained from any site in the site collection that has this web part.
  • Tools needed:
    • SharePoint Designer (to make one quick change, export the web part, and then optionally roll back the change)
    • Some way to find the site’s GUID (see link to a tool below)

The Question:

What started out as a simple question has led to some interesting results. So interesting that someone somewhere else must have written this up. I’ve not found it, so here goes…

The question that started this was “why don’t list and library web parts have a ‘Export’ option?” Most other web parts do.

First some observations:

  • While editing a web part page, click a web part’s menu and you will usually see an Export option, except for list and library web parts.
  • List and library view pages are web part pages (they have “Edit Page” in the Site Actions menu") and the displayed list is a web part.

So how can you export a list web part?

Turns out to be pretty easy. Edit the page in SharePoint Designer and change one word.

  1. Open the site in SharePoint Designer and double click on a page with the web part (default.aspx, Shared Documents/Forms/Allitems.aspx, etc)
  2. In the code view find the web part and find
    <ExportControlledProperties>false</ExportControlledProperties>
    and change from “false” to “true”
  3. Save the page (this will “unghost” the page, but you can undo the changes after the export is complete – right-click the file in the Folder List and select Reset to Site Definition)
  4. Go to a browser and visit this page. Go to Site Actions, Edit Page.
  5. Click Edit in web part you just modified and click Export.
  6. Give the file a name and save it somewhere where you can find it in the next step.

To import the exported settings as a new web part:

  1. Visit your top level site in the site collection and go to Site Actions, Site Settings, and in the Galleries column click Web Parts

To add the web part.

  1. Nothing special here. Add this web part just like any other web part.

Some differences…

Oddly, the displayed columns are different. The AllItems view displayed Type, Name, Modified and Modified By. The new web part displays Type, Name and Modified By. This is easy to fix. Edit the web part and change the Selected View property to All Documents then you will get the same list of columns in both displays.

The new web part does not display a toolbar by default, but this can be enabled from the web part’s properties panel. If the toolbar is enabled you will see all of the buttons found in the AllItems page, New, Upload, Actions and Settings (depending on the current user’s security rights).

 

Now test the web part in a sub site….

Error!

    Unable to add selected web part(s).
    List does not exist.
    The page you selected contains a list that does not exist.

On the first attempt it appears that the new exported web part will not work on another site. Time for more research…

 

Find the missing GUID

Open the .DWP (.WEBPART in 2010) file created by the Export. Find these two lines:

SP 2007
   <ListName …..>{ list_guid_here } </ListName>
   <WebId ….> all_zeros_guid_here </WebId>

SP 2010

   <property name="ListName" type="string">{ list_guid_here } </property>
   …
   <property name="WebId" …>all_zeros_guid_here </property>

 

SharePoint uses Globally Unique IDs (GUIDS) to identify just about everything stored in the databases. Notice that the ListName has a GUID, but the WebId is all zeros. Replace the zeros with the GUID for the site that owns the list and all will then work.

 

How to find a GUID

I can’t find any place in the the pages exposed in SharePoint Designer where the web site’s GUID is used, although the list’s GUID can be found in some of the URLs (for example after clicking Settings, List or Library Settings). I wrote two little utilities to display a site’s GUIDs, one a Windows application and the other a page you can deploy to the LAYOUTS folder on the server.

See: http://techtrainingnotes.blogspot.com/2009/03/sharepoint-finding-sharepoint-guids.html

Quick note: Internally a site is call a “web” and a site collection is called a “site”. (go figure…) The utilities above use the web and site names.

 

Update the web part file

Edit the WebId element and replace the all zeros GUID with the site’s GUID:

  SP 2007”   <WebId ….> all_zeros_guid_here </WebId>

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

After updating the DWP file with the site’s (web’s) GUID, re-upload it to the web part gallery and go and test the web part in a sub site.


And for the “Strange Things” list… the GUID for the web site does not include brackets ( { } ) and is in lower case. The GUID for the list must have brackets and MUST be in UPPER CASE or it will not work.

 

 

Watch outs and warnings!

  • This has not been tested in a production environment – you are on your own! (Please let me know if it works or does not work for you)
  • So far I have only tested this on MOSS 2007 Enterprise and SharePoint Server 2010, but it should work in WSS and SharePoint Foundation.
  • I have tested this so far with document libraries and several lists such as Announcements, but not with every list and library.
  • This will only work within the same site, or within the same site collection. It will not work between site collections, between applications or between servers.
  • The view displayed in the web part is a copy of the view in the original list or library. Use Edit, Modify Shared Web Part to pick another view or to refresh the view.
  • Users will need rights to the original list or library. This web part is only a view of the real list.
  • Alerts will be stored in the site with the original list so alert management will need to be done from that site’s Site Actions, Site Settings menu.
  • Most menu options will display screens from the site with the original list, but when the user clicks OK, Cancel, Close, etc, they will return to the site with the web part. One exception is if an operation generates as error, the “Go back to site” link will take them to the list’s site, not the web part’s site.
  • Batteries not included, your mileage may vary…

 

Have fun, and let me know if this works or does not work for you.

 

.

67 comments:

Anonymous said...

You rock, works like a charm!

Anonymous said...

just to drop a comment,
it works...thanks bro.

thought of the idea, just didn't noticed that it must be deployed into a webpage before it works.

to those who says this doesn't work (in future maybe), deploy the webpart into the page before to see the effects, trying this out in sharepoint designer by substituting the GUID of list and web does not work.

Uzair said...

Cant you achieve the same results by saving the List or Document Library as a template (stp) from List Settings and then upload it to another site?

Mike Smith said...

Uzair,

No. Saving as a template and then creating a new list from that template will create a copy of the list. The steps in this article will create a web part that can be added to "Site B", but displays the list/library contents from "Site A". Two web parts, two different sites, but the same list.

Mike

Unknown said...

I found the WebID in the URL by going to Site Settings, then Content and Structure Logs, then using the drop-down for the site I selected General Settings and the resulting URL it took me to had the WebID after SPWeb between a pair of %3A codes. Just change the %2D codes to dashes (-).

Mike Smith said...

Kenneth,

Yes, that works too, but only if you have a publishing enabled site, or your site is a subsite of a publishing enabled site.

Fun how SharePoint has so many "ifs"!

Thanks for the tip!

Mike

Wei Cheng said...

I am using SharePoint 2010 server. When I insert the webpart to the page I can see my list but when I click save the page I got the error

Server Error in '/' Application.
Value does not fall within the expected range.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.ArgumentException: Value does not fall within the expected range.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[ArgumentException: Value does not fall within the expected range.]
Microsoft.SharePoint.SPWeb.GetWebRelativeUrlFromUrl(String strUrl, Boolean includeQueryString, Boolean canonicalizeUrl) +27887694
Microsoft.SharePoint.SPWeb.GetFolder(String strUrl) +24
Microsoft.SharePoint.WebControls.NewMenu.AddMenuItems() +2841
Microsoft.SharePoint.WebControls.ToolBarMenuButton.CreateChildControls() +702
Microsoft.SharePoint.WebControls.NewMenu.CreateChildControls() +100
System.Web.UI.Control.EnsureChildControls() +146
Microsoft.SharePoint.WebControls.TemplateBasedControl.OnLoad(EventArgs e) +62
Microsoft.SharePoint.WebControls.ToolBarMenuButton.OnLoad(EventArgs e) +49
System.Web.UI.Control.LoadRecursive() +66
System.Web.UI.Control.LoadRecursive() +191
System.Web.UI.Control.LoadRecursive() +191
System.Web.UI.Control.LoadRecursive() +191
System.Web.UI.Control.LoadRecursive() +191
System.Web.UI.Control.AddedControl(Control control, Int32 index) +350
Microsoft.SharePoint.WebPartPages.DataFormWebPart.CreateChildControls() +1527
Microsoft.SharePoint.WebPartPages.BaseXsltListWebPart.CreateChildControls() +2189
Microsoft.SharePoint.WebPartPages.WebPartMobileAdapter.CreateChildControls() +72
System.Web.UI.Control.EnsureChildControls() +132
System.Web.UI.Control.PreRenderRecursiveInternal() +61
System.Web.UI.Control.PreRenderRecursiveInternal() +224
System.Web.UI.Control.PreRenderRecursiveInternal() +224
System.Web.UI.Control.PreRenderRecursiveInternal() +224
System.Web.UI.Control.PreRenderRecursiveInternal() +224
System.Web.UI.Control.PreRenderRecursiveInternal() +224
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3394

Any idea?

Anonymous said...

wow, thanks Mike!

it work like a charm and your tool to get GUIDs is fantastic. Thumb up!

SAR said...

Great Post !
Your Solution works like a charm !
However to get the GUID of the parent site I used SharePoint Manager available at CodePlex.

http://spm.codeplex.com/

Thought I let you know.
Thanks for the solution.
Sar.

Mike Smith said...

SAR,

SharePoint Manager is a great tool, I use it all the time and highly recommend it. It's a bit dangerous for some users as you can delete and edit with it. Any technique that gets the GUID will work.

Mike

SharePointSue said...

I am trying this out with a document library and I had it working once but now I keep getting a "Value does not fall within the expected range" error. I can add the web part no problem (I had the List does not exist error until I added to proper GUID to the WebId poperty). I can see my document library with the documents when I add the web part but when I hit "Save and Close" I get this out of range error. I also get this error if I try to edit the web part. Did anyone else have any problems? I can't figure out what I'm missing.

Greg said...

Mike,

Thanks for your post. However we are having a problem.

1) I placed a ListWebPart for tasks on the parent site and saved page
2) I opened that page up in Sharepoint Designer 2010 and changed the export so it is true and saved it.
3) I then went back to the browser refreshed the page and exported the web part.
4) I then imported the web part and of course got the list error.
5) I then edited the .webpart and put in the correct webid for the parent site and then imported it again with no error.
6) I then went to the subsite and placed the new webpart on the page and voila... I see the items from the parent page.

BUT as soon as I tell it to save the page I get the following 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.

Troubleshoot issues with Microsoft SharePoint Foundation.

Correlation ID: 9d089cab-2e03-4966-a3cf-f35477a0f65b

Date and Time: 5/26/2011 1:32:51 PM
"

If I try to browse to the page I get the smae error. All I can do is either close the webpart or delete it so I can get back to the site. I tried several times with the same problem.

Do you have any suggestions???

We really need to be able to have subsites show and edit the list from the parent site. I am honestly shocked this isn't a default ability.

Thanks,
Greg

Mike Smith said...

Greg,

I don't have any quick answers for you. Do you have access to the web servers and the SharePoint logs? If so, search for the Correlation ID in logs and see if there is anything helpful there.

Yes, I agree that cross-site web parts should be a part of SharePoint. You might also look at the Content Query Web Part (if using the Publishing features) or the SharePoint Designer Data View web part to work across sites.

Mike

Anonymous said...

Hi Mike

Works great, but if there are folders inside the library, it fails. It changes the relative path of the folder to the current site instead of the parent site, and so doesn't resolve the path and fails. Have you encountered this issue at all? Any pointers to resolve it would be great.

Thanks
Jason

Mike Smith said...

Jason,

The only quick idea would be to add a Content Editor Web Part just below the new web part with a JavaScript routine to fix the links. I'll add this to my "to do" list, but that list is a bit long right now.

Mike

Jody said...

Mike,

My name is Jody, I work for Grace-Hunt out of Hudson, MA and just wanted to drop you a note regarding why some people are unable to use your solution.

Users who are experiencing the "Error
An unexpected error has occurred." are experiencing it because their library/list has content editing enabled. You CAN edit content types but while you're editing your webparts will be broken. As soon as you go back to Advance Settings and turn it off, your webparts will work (this took about 4 hours for me to debug)!

Thank you so much for your solution. It’s by far the most eligant and easiest to package (I wasn't about to ask my client to create a SOAP connection for every subsite).

Keep up the good work!

The Everyday Philosopher said...

This is great! Thank you for posting (also to Jody with the content type fix) :)

Anonymous said...

This solutions is absolutely incredible! Thanks so much!

Greg Ferguson said...

Mike,

First off, thanks for posting this information. It was really helpful for me.

I wanted to share with you a way to enable the export button without having to use SharePoint Designer (aka SharePoint Destroyer). Simply drop a content editor webpart on the page and paste the following bit of JavaScript in the content editor webpart source view.

<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>

Another interesting point I thought I could share was a way to get the GUID of the site using only the browser (tested in Internet Explorer). Open the 'Content and Structure' under site settings. Roll your mouse over the name of the site that you want to get the GUID of and in the bottom left of the browser window you will see some javascript postback stuff that includes the GUID of the site (SPWeb).

Both of these tips have been tested in MOSS 2007 SP3.

Marco Diaz said...

i have problem when i try insert 2 o more of this control.
please can you help me.

Mike Smith said...

Marco,

I have not see that issue. Can you tell me more about what you are seeing? Is there an error message? Are you adding two of the same web part into the same page? Or, two web parts pointing to lists in two different site?

Mike

Anonymous said...

I have done everything as said. My issue is this. I have a huge sharepoint site for my company. the list is on the main site collection
http://site

i am using a page layout for a subsite. on this page layout, i want the listview webpart (i've made a view webpart for this), input it onto the pagelayout, so when a new page is made, it already has this web part on there.

i've done all that you've said. export the webpart, edit the WebId, which had to change the type for it to work, otherwise i couldn't view the webpart in the gallery

{70EB6A21-4E9F-4F8C-9D38-920C882FC51A}

i've tried w/o braces, w/, upper, lower, and also had the type="System.Guid, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" as well.

any help would be appreciated.

thanks

Mike Smith said...

Anonymous,

> the list is on the main site collection

Are you trying to work across two site collections? This approach will only work between sites in the same site collection.

Mike

Anonymous said...

Mike

Any ideas on this error?

You cannot add a Grid view accross webs.

I updated the GUID and uploaded the web part and attempted to add it to the page but this error comes up.

I need to display the datasheetview of this list from one subsite to another subsite in the same site collection.

Mike Smith said...

Anonymous,

Sorry, but I don't know of any way to use a datasheet across sites, except for maybe on an external list (BCS).

Mike

meusfilia said...

Mike,
I have the webpart in the top level gallery but when I try to add it in a subsite I just get "list doesn't exist". I then tried creating the library on the subsite but the webpart isn't available there.
I checked the list/web guid's and they are correct.
Before I read your solution, I actually got this working a different way on one site, but neither I nor MSFT engineers can figure out how I did it.

meusfilia said...

Update: my dumb mistake - I was using the LIST GUID instead of the SITE GUID. Now it works perfectly.

Bill said...

Works like a charm. Thanks for being thorough!! I found this method on several other sites but they were all missing 2 steps that you detailed.Thanks!

Unknown said...

So this works great for me except if I add more than one of these web parts on a page… then I get a “List Not Found” error when I edit any one of the web parts. (Note: Clicking back and refreshing the page shows that my changes stick – so theoretically it works but it will be confusing error for my clients.) They must be conflicting with each other for some reason. Been searching for answer with no luck, any ideas?

m.klinge said...

It would seem this solution only works in a parent-child (and child-parent) relationship - at least in sharepoint 2003.

I can't get it to work between two sites under the same collection eg:
Sites/Site1
Sites/Site2

It may very well be a limitation of this version of sharepoint :)

Thanks for your article - it did help me a lot :)

//M

Anonymous said...

Hi Mike,

Thanks for this quick tip for exporting ListView Web Part. But I am facing one problem after implementing this solution.

I have one site collection named
http://sp2010/site1 where I have discussion board. I exported discussion board web part and imported it to
http://sp2010/site1/site2.
But when I try to click to any discussion within Site2, it it giving me server exception.

Any help would be greatly appreciated.

Unknown said...

Mike,

great article! Works like a charm for lists in SP 2013 Foundation.

Unfortunately I'm unable to get document libraries working, eg; I can add them to subsites but the functionality of the document library itself is missing
- unable to upload files
- unable to open folders
- unable to open files

My guess it has something to do with the way SP navigates to folders and files in a document library as it adds an extra part to the url (?RootFolder=foo) when opening a folder in the document library but i haven't found a way to get it working.

Any thoughts?

Ivo

Mike Smith said...

m,

I have not tested this with SP 2013, but would expect that it would not work, or work differently, because of the JavaScript things that are now being done with HTML5. I'll be taking a look at it, but it will be a while...

Mike

Anonymous said...

@Ivo - It's not working in Sp2013 at all. How did you manage to get it working?

doctor61 said...

Hi Mike, thanks for sharing this awesome solution to a popular problem with SharePoint. I used your instructions and app and it worked beautifully. But I could not completely achieve what I was hoping for, maybe you can help me with it? My goal was to merge a Calendar from a parent site to one in a subsite, so that when you add events in the subsite calendar the parent site's calendar won't be affected. I am assuming the solution to this problem is much more complicated than the method you are sharing here? Do you have any suggestions or can point out any other useful resources like yours?
Thank you so much.

Mike Smith said...

doctor61,

While there are a number of ways of rolling up lists, I've not found one so far that will support a calendar view. (external lists for example)

The only solution I can think of is a either a Visual Studio workflow, event receiver or other code solution that would copy the top level site calendar updates into the child site calendar.

You can "rollup" calendars from multiple SharePoint sites from within Outlook, but you were asking about displaying the merged calendars in a site.

Try posting the question here: http://social.msdn.microsoft.com/Forums/en-US/sharepointgeneralprevious/threads

Mike

Unknown said...

Doctor61, check calendar overlays
http://community.bamboosolutions.com/blogs/sharepoint-2013/archive/2013/03/15/how-to-use-calendars-overlay-in-calendar-lists-in-sharepoint-2013.aspx

That should solve your problem.

(not sure if this function exists in SP2010)

Unknown said...

Doctor61, check calendar overlays
http://community.bamboosolutions.com/blogs/sharepoint-2013/archive/2013/03/15/how-to-use-calendars-overlay-in-calendar-lists-in-sharepoint-2013.aspx

That should solve your problem.

(not sure if this function exists in SP2010)

Mike Smith said...

Doctor61,

Ivo is right. I had forgotten that the overlay feature worked across subsites.

And yes the feature works in SP 2010.

Thanks Ivo!

Mike

ruskin said...

IS there anyway to do this without using Sharepoint Designer. Can't install it at my work :(

ruskin said...

Is there anyway to do this without sharepoint designer? Cant install it at my work :(

Mike Smith said...

ruskin,

I have not tested this, but it should work...

If the page is stored in a library, Site Pages, Pages, etc., then download the file and edit it using Notepad and then upload back to the library. (Try this with a test page first!)

Mike

Ryan said...

After I have added the web part to a subsite, is there any way I can add an item to the web part list in a workflow attached to another list in the subsite?

I'm trying to create a collection-wide log list that generates a log-ID and then sets the ID value on the list item to that log-ID (and want the ID to be unique across all subsites).

Anonymous said...

Hi Mike,

Any Idea why I get this error when I try to add the .dwp file to the Webparts "The file you imported is not valid. Verify that the file is a Web Part description file (*.webpart or *.dwp) and that it contains well-formed XML."

Any help would be appreciated.

Thanks.

Mike Smith said...

> "The file you imported is not valid.

Is the page you exported from still working ok?

Are you importing it back into the same SharePoint server or site collection?

Check to see if the XML in the file is well formed. XML is case sensitive. I.e. "<ExportControlledProperties>false</ExportControlledProperties>" will work while "<exportcontrolledproperties>false</ExportControlledProperties>" will not.

Check to make sure that for every start tag there is a matching end tag.

Anonymous said...

Hi Mike,

Thanks for getting back. Yes the page I exported from seems to be working well.

Yes I have a Parent site and another subsite in the site collection. I followed the steps and exported the document library and it seems to import fine but when I click on it I receive the error mentioned.

would tags like this cause issues: ?

Mike Smith said...

> tags like this...

To post HTML in these comments replace "<" with "&lt;" and ">" with "&gt;"

Anonymous said...

could this tag be causing an issue? <MissingAssembly>Caanot import this webpart. <MissingAssembly>

and would something like this?
<Height />

The tag above seems to be closed.

Mike Smith said...

> could this tag be causing an issue? <MissingAssembly>Caanot import this webpart. <MissingAssembly>

Yes, the end tag is not a closing ("/") tag. Try:

<MissingAssembly>Caanot import this webpart. </MissingAssembly>

Jimmy said...

Hello Mike,

I was able to add a parent list to a sub-site page, but when i try to delete a list item from the subsite using the SP ribbon button, the systems throws “List does not exist….” error, but if i edit the item and click on delete button inside the edit form it works.

I have checked the ListId, WebId and ListName and they are all set to the parent values.

What can be causing this behaviour?

Any help would be welcome.
Thanks in advance

Mike Smith said...

Jimmy,

I would not be too suprised if the ribbon did not quite understand what we are doing here as it is dynamically generated and the JavaScript may be making some assumptions. I'll post back here if I can find a workaround.

Mike

Anthony said...

Works fine in 2013 Foundation - thanks very much!

Unknown said...

after many attemps,,i'v found that Filter feature support the greater than and less than.

ie:http://sptest/DocLib5/Forms/AllItems.aspx?FilterField1=Modified&FilterValue1=2014-04-01&FilterOp1=Gt&FilterValue1=2014-04-17&FilterOp2=Lt.

Tim said...

This worked great surfacing a doc library to the parent site, but unfortunately failed when I tried to do the same for the "Post" list of a web blog site. The error is "invalid list template" Saving as a template is not an option for the Post list otherwise I would have tried to create one and deploy in the parent site.

Unknown said...

Thanks a lot Mike.
It works on SP2013 as well. One can get Webid by IE debugger (F12) or Firebug by going to "Content and Structure" right click on "-" "+" icon of which you want to know the id. you will see something like this <a href="javascript:__doPostBack('TreeView1','sArea:?SPWeb:31f18323-e7da-4b9a-8a09-293f24449589:" SpWeb: is your SpWeb id

Bikram said...

Dear Mike
I am facing a problem. For a document library used in a webpart, the folder urls are distorted. The webpart tends to make its own urls which do not exist, thus breaking the links to the original folder. Sharepoint gives you a nice error.

Is there a way to prevent this?

Bikram

Mike Smith said...

Bikram,

Not enough information... What do the URLs look like and what should they look like? Do you have one URL for internal users and another for external? (I.e. http://sharepoint for internal and http://sharepoint.yourcompany.com for external) Check with your server admins to see if there might be an issue with Alternate Access Mappings (AAM).

Mike

Patrick said...

Hey! Was able to use this guide successfully to create web parts on sub sites that are linked to lists on the parent site. The issue I've run into now is this:

If I try to add a web part to a sub site, that already has linked web parts, it fails and I get the unfortunately common "List does not exist" error. This only happens when trying to add "local" web parts that point to lists that reside on the sub site. I can add as many "linked" web parts as I like no issue.

I tried editing the GUID for the WebID for the local web parts, as when I looked it showed up as all zeroes. However, the GUID I came up with (via the REST service, which worked perfectly for the linked lists) didn't resolve the issue.

Anonymous said...

I want to copy webpart from one webapplication to the other web application.
I copied it by using Exporting and uploading Option.
Now that i have copied. I tried to add the web part on the Home page. And i get the Error
"a web part or web form control on this page cannot be displayed the type is not registered as safe".
PLEASE HELP ME!

Mike Smith said...

"I want to copy webpart..."

What kind of web part? List, Library, custom, third party?

Note that you are never copying a web part, you are exporting and importing the web part's properties. If a web part depends on a certain feature to be enabled, then that feature has to be enabled on the other site. If a third party, or custom, web part has been deployed to web app "A" then it has to also be deployed to web app "B" where you want to copy the web part.

Many web parts depend on a GUID for a list and a GUID for a site, and that site GUID is often set to all zeros to indicate "current site". You will need to find the GUID and replace the zeros.

Mike

MaxPower555 said...

Dude, You rock!

This also works in SharePoint 2013 as well!! Why oh why doesn't Microsoft allow this OOTB...

Since SP 2007 its been a hinderance. They are forcing you to use such things as Content Search or Content Query webparts but they just don't have the same look and feel.

FYI, I tried to run the powershell command get-spsite | select Url,ID BUT! this resulted in the wrong guid. I went to the Edit site Title, Description and Icon and like suggested above, in between a pair of %3A's is the right site guid.

Many Thanks!

Anonymous said...

For those of you that have received the error "list does not exist" when you try and checkin/out or delete a file. This happens in SP365 when using the ribbon menu. If you use the click menu on the file you can do these functions...well at least checkin/out. There is no rhyme or reason to the issue....MS needs to fix it.

Also, would be nice if you could I don't know...use drag and drop OR quick edit when you share the library/list between parent/sub.

Anonymous said...

For Sharepoint Online I can confirm the issue of being unable to use the full library functions that the above poster is referencing. Here is the exact steps:


1. On child site library created view besides default called "Public" with type list
2. Opened view in sharepoint designer and saved webpart to file making sure to say "yes" to copying content
3. Uploaded .webpart to site gallery
4. Created page on parent site
5. Inserted library web part

So far so great! Everything loads like it should and I'm looking directly at the library as if it were linked from this site. THEN the trouble starts:

1. Cannot click in to or search any folder
2. Cannot drag/drop or add/delete any file

Any help would be appreciated.

Thanks,
Adam

Anonymous said...

Mike: Thanks a lot for this post. It really worked for me. I however have one issue. The list view that I have exported has 3-4 items however, after I export it I get to see ONLY 1 item under the new site (which is on the same collection site). Any thoughts! Would appreciate your insight! thanks in advance for your help!

Mike Smith said...

Anonymous,

Might be permissions. Are you using the same account with both sites?

Mike

Tena Matta said...

Are you getting the "List does not exist..." error when you try to save a SharePoint List as a web part in SharePoint Designer?

There is an easy but completely undocumented way to fix this. You must create a new custom view that uses a "Style" of "Basic Table". Then when you go into SharePoint Designer, click on that new custom view (I name all of mine SPDesigner just for simplicity / consistency), and then click inside the page and then click "LIST VIEW TOOLS >> WEB PART >> To Site Gallery". After you do this a pop-up window will come up asking if you want to maintain the original list data. If this pop-up does not appear, your web part will not work right.

Thanks!

Latosha Hanson said...

@Tena Matta - Days spent researching why I was following all steps exactly and still could not successfully save a Doc Lib with content, as a Web Part. (kept getting the 'list does not exist error.) Your comment was what helped me with that last hurdle that, as you stated, was not documented anywhere! Gah! Thank you! LH
Unrelated side note, your original comment was made on my birthday, and my 10yr wedding anniversary! Haha!

Note to spammers!

Spammers, don't waste your time... all posts are moderated. If your comment includes unrelated links, is advertising, or just pure spam, it will never be seen.