0

I am trying to deploy a customized Content Editor web part (Just Title, chrome type etc. is customized, otherwise it is just a CEWP) in a farm project which already has lots of things in it.

I have saved an existing web part as dwp, then edited the dwp and wrapped it in a module. My problem is, when I create a Site Collection,using the template that this feature is bound to, it works fine but when I create a sub site under the site collection I get : "Failed to instantiate file from module The specified list does not exist. while provisioning web part" error

<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  <Module Name="Key Staff Information" List="113" Url="_catalogs/wp" >
    <File Path="KeyStaffInformationWebPart\Key Staff Information.dwp" Url="KeyStaffInformation.dwp" Type="GhostableInLibrary">
      <Property Name="Group" Value="Custom Web Parts" />
     </File>
  </Module>
</Elements>
  • I have tried changing the Type to Ghostable, however that does not deploy the web part, can't find it in the gallery.
  • I have tried playing around with elements.xml, tried adding RootWebOnly="TRUE", didn't make a difference.

I am doing something silly here? The feature it is in is scoped as Web - could that be the problem?

2 Answers 2

1

The feature should be scoped to site

As you are aware Webpart gallery exists at site collection level.

0
1

Add the webpart into a "Site" scoped feature

This is so that it will create a spdata entry to add your webpart as a safe control into the web.config.

Activate the "Site Collection Feature" that you created for the webpart on the target site collection

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.