0
votes

We are working on a SharePoint Site where we have created lot of webparts. Now so far we have been creating SitePages for these webparts manually and adding webparts to those. It takes lot of time in any environment and its difficult to move from environment to environment.

What is the ideal way of doing it? How can we automate sitePage creation process and hopefully add webpart to it by some scripts?

Appreciate your help!

1

1 Answers

0
votes

Well you have lot easier way to what you wanted to achieve, in a single click you can do it.

This is how we need to deploy & create pages:

  1. Create a Feature that will provision new pages to the Library.
  2. To Deploy web part use AllUserWebPart tag in the pages so that it comes automatically when the page is created
  3. Finally Pack all these items inside a WSP solution & deploy to your environment.
  4. Once deployed go to the Feature section and Activate the feature, you are done [Single click]

SO already has lots of questions related to how to provision pages using Feature & how to add web part.You can refer to below links for reference.

  1. adding Page 1
  2. adding page 2