How to Export & Import Web Parts in SharePoint(转)

本文详细介绍如何在SharePoint中导出已配置好的WebPart,并将其导入到同一站点集合内的其他站点,验证了导出与导入过程中WebPart的所有设置是否能够完整保留。

原文:http://community.bamboosolutions.com/blogs/sharepoint_blank/archive/2009/01/08/how-to-export-amp-import-web-parts-in-sharepoint.aspx

 

While blogging my continuing investigation into whether or not it's possible to deploy a My Site Web Part into a Team Site yesterday, I promised a step-by-step look at my latest nugget of SharePoint learning.  That nugget?  How to export a Web Part from one site and import it to another site within a site collection.  So as to continue the learning process, I aim to answer another question that has since occurred to me regarding the exporting/importing of Web Parts, and that question is: When you export/import a Web Part that's already been configured, do all of your existing settings come along for the ride?  I'll put my cards on the table and say outright that I'm assuming the answer to this question is yes, so let's find out together, shall we?

For the purpose of this experiment, I'm going to use the World Clock & Weather Web Part that's on my My Site (since, as a result of my ongoing investigation, I already know that I won't be able to use any of the My Site-specific Web Parts), and I'll begin by selecting the Export... item from the dropdown menu in the upper right of that Web Part:

ExportMenuItem.jpg

Clicking that Export... button brings up the following message:

ExportFileDownload.jpg

After choosing the Save option, I'll choose where to download the DWP file (desktop probably being the handiest option since once I've imported it, I'm just going to delete the file anyway.  Note:  In some cases, the name of the Web Part may be different than the name of the DWP file, so don't be alarmed) on the resulting screen.

Once I've saved the World Clock & Weather Web Part DWP file to my desktop, I'm going to navigate to another site in our collection, the site where I want to import the Web Part.  I'll be heading to our team's site because, well, I have edit rights there.  Once I've chosen the page to which I want to import the Web Part, I'm going to first select Edit Page from the Site Actions dropdown menu on that page and then, once in Edit Mode, I'll click an Add a Web Part button on the page.  Clicking that button will bring up the Add Web Parts popup, and here I'll choose the Advanced Web Part gallery and options hyperlink at the bottom of the page.  Doing so will render the Web Part task pane at the right of the page in Edit Mode, and clicking the dropdown button in the Browse section of that pane will provide the Import option I seek:

BrowseImport.jpg

Clicking the Import option will refresh the task pane with the Import view, in which I'll simply browse to the DWP file on my desktop and then click Upload:

ImportUpload.jpg

Once the upload is complete, the task pane will refresh with a new section, confirming the Uploaded Web Part and providing placement options for its importation onto the page:

UploadedWebPart.jpg

Just as you would expect, after choosing the placement and then clicking the Import button will place the imported Web Part on the page in the desired location ... and guess what?  The version of the Web Part which gets imported does indeed retain all of the configuration options from its original location.  Sweet!

转载于:https://www.cnblogs.com/Jack-Chang/archive/2010/03/10/1682760.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值