0

We have designed a custom Content editor web part and we exported the dwp file and added it in an site collection (Web part gallery ) and the web part is working fine when we add in any sub site in that site collection .We have about 60 Site Collections is there any way we can upload this into all the web part galleries ?

2 Answers 2

4

you can use PowerShell script to upload your dwp file to web parts gallery.

$urls = { "url1", "url2", ..., "url60" }
$srcPath="c:\temp"
$libraryFolder="_catalogs/wp"

foreach($url in $urls){
     $libraryUrl=$url + "/" + $libraryFolder
     UploadFile $srcPath "your.dwp" $libraryUrl $libraryFolder 
}
3
  • Just to add, uploading the webpart file to gallery does not itself add safe control entries in the web.config file. Aug 14, 2013 at 9:35
  • @NadeemYousuf, I think that Anil configured CEWP on a page and then exported it. In this case safe control for CEWP is already added.
    – Alexander
    Aug 14, 2013 at 10:33
  • Agreed. My comment was only for the sake of information. It may be that his site collections belong to different web applications. Aug 14, 2013 at 10:46
1

You can create a feature. If all site collections are in same web app deploy it at web app level else deploy it at farm level. Then activate your feature and you are good to go.

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.