简体   繁体   中英

Creating Sites and WebParts - SP2010

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!

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM