Export and Import webparts

Once you have configured a webpart, you might want to reuse it in other sites or pages. Many times you create a webpart in your test sites and want to move it to the live pages.

Sharepoint allows you to export the webparts as XML files (with .webpart or .dwp extension). You can save this file in your local machine or shared folders and then import it to other sites.

To export a webpart, you can follow these steps:
  1. Open the page where your webpart is, and click on edit page(on page ribbon or site actions menu)
  2. Click on the down arrow of the webpart title bar
  3. Choose export option
  4. Save file

If you can't see export option on the webpart menu, it may be because:
  • The webpart you are trying to export is not designed to be exported. ListViewWebpart is one such example
  • The webpart export is disabled by administrator using web config of the web application. You will have to contact your farm administrator to allow exporting the webpart

Once you have exported the webpart, you can import it to a page following these steps:
  1. Open the page where you want to import webpart, and click on edit page(on page ribbon or site actions menu)
  2. Under page tools -> Insert Ribbon -> click on webpart
  3. Click on the down arrow at the left bottom label "Upload a webpart"
  4. Browse your exported file and and click upload
  5. When you choose the webpart option under Insert ribbon, you can see your imported webpart under the "Imported web parts" category



Now you can add the webpart in the page.

If you want to use the wepart on multiple pages/sites, you can also save the import/upload the webpart in the webpart gallery.  Steps to add a webpart in the gallery:
  1. Go to top level site setting
  2. Click on the webpart link under Galleries section
  3. Save the webpart file
The webpart will now be available under your chosen group.


 

No comments:

Post a Comment