//[SampleMetadataTag(Name = BuiltInTagNames.SampleHidden)] public void CanDeploySimpleSiteFeedWebPartDefinition() { 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); }
public static ModelNode AddSiteFeedWebPart(this ModelNode model, SiteFeedWebPartDefinition definition, Action <ModelNode> action) { return(model.AddDefinitionNode(definition, action)); }
public static ModelNode AddSiteFeedWebPart(this ModelNode model, SiteFeedWebPartDefinition definition) { return(AddSiteFeedWebPart(model, definition, null)); }
public static TModelNode AddSiteFeedWebPart <TModelNode>(this TModelNode model, SiteFeedWebPartDefinition definition, Action <SiteFeedWebPartModelNode> action) where TModelNode : ModelNode, IWebpartHostModelNode, new() { return(model.AddTypedDefinitionNode(definition, action)); }
public static TModelNode AddSiteFeedWebPart <TModelNode>(this TModelNode model, SiteFeedWebPartDefinition definition) where TModelNode : ModelNode, IWebpartHostModelNode, new() { return(AddSiteFeedWebPart(model, definition, null)); }