API support

CSOM SSOM

Can be deployed under

WikiPage WebPartPage

Notes

ScriptEditorWebPart provision is enabled via SiteFeedWebPartDefinition object.

Both CSOM/SSOM object models are supported. You can deploy either single object or a set of the objects using AddSiteFeedWebPart() extension method as per following examples

Examples

Add Site Feed web part

var siteFeed = new SiteFeedWebPartDefinition
{
    Title = "Site Feed",
    Id = "m2SiteFeed",
    ZoneIndex = 10,
    ZoneId = "Main"
};

var webPartPage = new WebPartPageDefinition
{
    Title = "M2 Site Feed provision",
    FileName = "site-feed-webpart-provision.aspx",
    PageLayoutTemplate = BuiltInWebPartPageTemplates.spstd1
};

var model = SPMeta2Model.NewWebModel(web =>
{
    web
      .AddWebFeature(BuiltInWebFeatures.SiteFeed.Inherit().Enable())
      .AddHostList(BuiltInListDefinitions.SitePages, list =>
      {
          list.AddWebPartPage(webPartPage, page =>
          {
              page.AddSiteFeedWebPart(siteFeed);
          });
      });
});

DeployModel(model);