views:

27

answers:

1

Hi,

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!

A: 

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
Kusek
Thanks for response! The links attached talk about Layouts/Application pages. I need to create SitePages. May be I didn't get it.
SPT.DEV2344