I need to create new custom site definition which inherited from Publishing Portal with all features and functionality. What is the best way to do this in Sharepoint 2013?

  • Why would you inherit a site definition ? , and I don't think if it's even possible, you can always copy a existing site definition and then modify as you required. Sep 4 '13 at 8:35
  • 1
    Or use a WebTemplate, feeling more modern and fresh ;) Sep 4 '13 at 8:46
  • off course you would be better creating Web Templates then creating site definitions. Sep 4 '13 at 9:08
  • @RobertLindgren could you please explain why web template is better than site definition? Sep 13 '13 at 8:48

You can create a site definition with Visual Studio 2012 taking the onet.xml in

C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\15\TEMPLATE\SiteTemplates\PUBLISHING\XML\

as starting point and add your custom features, modules, pages or whatever in it.

  • I copied onet.xml from PUBLISHING\XML\ and deployed new custom site definition. When I was creating site collection based on this site definition I received such error: System.Runtime.InteropServices.COMException: <nativehr>0x8107058a</nativehr><nativestack></nativestack>The SharePoint Server Publishing Infrastructure feature must be activated at the site collection level before the Publishing feature can be activated. Could you help me with this? Sep 4 '13 at 13:59
  • That error states that in the Site Collection settings you have to go to Site Collection Features --> Activate SharePoint Server Publishing Infraestructure. After it is activated try to create a new site with your customized site definition. If this doesn't work either, Save the out of the box publishing site as a template and use it in other sites
    – Alvmad
    Sep 4 '13 at 14:02
  • you have to go to Site Collection Features --> Activate SharePoint Server Publishing Infraestructure Do you mean root site collection? Because custom site collection can't create due to error. If yes, I have already done it and received the same error Sep 4 '13 at 14:11
  • I mean the top level site collection where the site is going to be created
    – Alvmad
    Sep 4 '13 at 15:25

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.