0

can we create a site definition with publishing page library, sub sites with blog and wiki template and then custom columns(like taxonomy field)?

I want to understand which approach is better in SP 2013, site definition or web template or feature stapling or any other way.

0

Yes you can.

  1. Create a Master list and have it as your site collection information list to create new site collections.

  2. Create an event receiver and trigger an event after item created in that list.

  3. Wrap all the information to your event receiver which you wanted and have same info in the list columns as items.

  4. You can create a master page, page layout, list definition and all other features like taxonomy to your event which is coming as the items from your master list and use it to create the site collection you need.

  5. Event receiver will take much time to run based on the number of actions you want to it to perform. But this can help you out

Thanks.

  • Thank you @sukumar, I had tried similar options before with console in timer job instead of event receiver which worked well. I was wondering whether i have alternate options like Mike suggested above – Sivanrv Sep 24 '18 at 9:33
0

None of the above. Create a powershell script to create sites, subsites, lists, etc. Specifically, check out the pnp powershell library, and more specifically, the pnp provisioning framework. Since it uses the CSOM, it can be run from remote machines, and is compatible with different versions of SharePoint, including online. (You may have no plans for a migration at the moment, but when you do move to a new version, it's nice not to have to spend a huge amount of time rebuilding these things.)

If you need to have a user create these sites without powershell, use the pnp libraries from a separate application that is called from SharePoint. Again, this way if you migrate to SharePoint online, for example, the provisioning application can simply be moved to Azure. Another benefit is that the provisioning code can be deployed and updated without having to recycle any app pools, etc.

  • Thank you for quick reply Mike, I want users to create the site collection, how to call pnp libraries from SharePoint? I would need to add publishing page library & few pages with site creation, so i thought site definition would be better option, please suggest. – Sivanrv Sep 21 '18 at 13:24
  • The following blog post has a nice overview of remote provisioning (scroll down). The technique it uses is to override the create subsite link. Since you're trying to create site collections, just follow a similar procedure, but don't do that one step and just put the link elsewhere. So, user clicks the link, they land on a custom SharePoint App, they fill in the form with site name, etc., and click a button that runs your code to provision the site collection. blogs.msdn.microsoft.com/vesku/2013/08/23/… – Mike2500 Sep 21 '18 at 13:33
  • btw: site definitions were a thing back in 2007, but should be avoided at this point. Strongly avoided. – Mike2500 Sep 21 '18 at 13:34
  • Thank you for the suggestions mike, let me try the options. Btw link you gave is not working, can you please check? – Sivanrv Sep 24 '18 at 9:30
  • Weird, the link is working for me. The title of the blog post is "Site provisioning techniques and remote provisioning in SharePoint 2013", by Vesa Juvonen – Mike2500 Sep 24 '18 at 12:26

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.