Skip to content

Instantly share code, notes, and snippets.

@chrisobriensp
Created March 13, 2017 15:04
Show Gist options
  • Select an option

  • Save chrisobriensp/f0fa4e02c1290094c64a09ed1a005a78 to your computer and use it in GitHub Desktop.

Select an option

Save chrisobriensp/f0fa4e02c1290094c64a09ed1a005a78 to your computer and use it in GitHub Desktop.
Shows adding modern web parts to a page and setting properties..
// add video embed web part..
ClientSideWebPart videoEmbedWp = page.InstantiateDefaultWebPart(DefaultClientSideWebParts.VideoEmbed);
videoEmbedWp.Properties["videoSource"] = "https://chrisobriensp.sharepoint.com/portals/hub/_layouts/15/PointPublishing.aspx?app=video&p=p&chid=4b7ef33e-ed56-4c75-b3ad-61488cc82474&vid=1e07b31d-21fa-4326-9033-91adf1a90708";
videoEmbedWp.Properties["captionText"] = "ALM video";
videoEmbedWp.Properties["showInfo"] = false;
videoEmbedWp.Properties["embedCode"] = "<iframe width=853 height=480 src='https://chrisobriensp.sharepoint.com/portals/hub/_layouts/15/VideoEmbedHost.aspx?chId=4b7ef33e%2Ded56%2D4c75%2Db3ad%2D61488cc82474&amp;vId=1e07b31d%2D21fa%2D4326%2D9033%2D91adf1a90708&amp;width=853&amp;height=480&amp;autoPlay=false&amp;showInfo=true' allowfullscreen></iframe>";
videoEmbedWp.Title = "Associated video";
page.AddControl(videoEmbedWp);
// add Yammer embed web part..
ClientSideWebPart yammerEmbedWp = page.InstantiateDefaultWebPart(DefaultClientSideWebParts.YammerEmbed);
yammerEmbedWp.Properties["yammerFeedURL"] = "https://www.yammer.com/chrisobrien.com/#/threads/inGroup?type=in_group&feedId=4059924&view=all";
yammerEmbedWp.Title = "Associated Yammer group";
page.AddControl(yammerEmbedWp);
@vinmht
Copy link

vinmht commented Jan 2, 2019

YammerEmbed webpart , By setting yammerFeedURL properties it will add classic webpart ,New webpart accept only yammer group name.
How we can only provide group name only , Which property need to set with groupname

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment