0

I created a new sub site from custom site template. I deployed my custom web template to this site collection. I create a new site and select my custom web template.

But I dont understand, why I need to do feature activation manually? Is it possible to activate features by code when site created? Find my onet.xml code

<WebFeatures>
        <Feature ID="6e86842d-89db-4c4f-bd04-37f41dc28754"/>
        <Feature ID="891e49d5-a8ea-40c5-9930-ea3079fb7370"/>
</WebFeatures>
  • 2
    The features mentioned in <WebFeatures> should be automatically activated – Nadeem Yousuf Mar 24 '15 at 6:37
  • It's not happen in newly created subsite(Using my custom site template). Any reason? – Sivakumar Piratheeban Mar 24 '15 at 6:39
  • 1
    Are these features installed? Can you see them on site features page? – Nadeem Yousuf Mar 24 '15 at 6:41
  • Yes, Features are there under site features. But not activated by default. – Sivakumar Piratheeban Mar 24 '15 at 6:58
  • 1
    Few things, I would do to make sure everything is correct. The Scope of the features should be Web. Check that Id is correct. Finally, put a break point in feature activation code and check if it is hit. – Nadeem Yousuf Mar 24 '15 at 7:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.