1

I have a Site Template which includes the SP List Item Copy Feature. This Feature was enabled on the site when I created the template.

My issue is that whenever I create a new site with this template, I have to Disable and then Enable the Copy Item feature before it will work properly.

Is there something specific that could cause this? If so, how can I prevent it from making me re-enable that feature for every new site?

1 Answer 1

1

I'm unfortunately all too familiar with this issue; in short, starting with SharePoint 2010, whenever a site is saved as a template, any currently activated Site Features (as well as Site Collection Features scoped to subsites) are referenced in the template in a way that then requires that Feature to be present & activated on any new sites.

My company often packages & deploys Site Template in our projects & the only sure fire way we've found to "clean" a template is:

  1. Save the WSP to your local machine
  2. Change the file extension to .CAB
  3. Use an archive tool (i.e. 7-zip) to unpack the CAB file
  4. Within the unpacked CAB you will see a folder whose name will be the original name of your Site Template + "WebTemplate"
  5. Within that folder will be a sub-folder whose name is just the original name of your Site Template
  6. Within that folder is the ONet.xml file
  7. Traverse the XML to the <SiteFeatures> section:
<Project>
  <NavBars>...</NavBars>
  <Configurations>
      <Configuration>
          <SiteFeatures>...</SiteFeatures>
          ...
      </Configuration>
  </Configurations>
</Project>
  1. Delete the contents of the <SiteFeatures> section, but do not delete the opening & closing <SiteFeatures> nodes themselves.
  2. Save & close the ONet.xml file
  3. Repack the CAB file (Using a tool like CABArc) and change its file extension back to .WSP
  4. Upload, activate and use the template

We've been successfully using the process for years now - hope it helps!

2
  • Won't this just remove the Features entirely, forcing me to enable the Copy Item feature again after Site Creation anyway?
    – Lando
    May 14, 2014 at 16:17
  • In essence, yes; this ensures the Feature is not flagged as enabled when the site is first built. The issue being that SharePoint was saving that flag (because, as you found, having the Feature enabled when saving the site as a template causes that) even though it wasn't. Having fixed that aspect, you could then leverage any number of methods to put some logic into your site creation to properly activate the feature on initial site load, say via CSOM call. May 14, 2014 at 17:49

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.