Friday, March 16, 2018

How to: Embed the Yammer All Company feed on a modern page in SharePoint Online

This is not hard at all these days, as the Modern Yammer web part recently got updated and allows you to pick “All Company” as the feed to display.

First add the Yammer web part to your page.

image

Then search for “All Company” and pick it. Previously you had to paste the link to a group, but this search experience makes it a lot easier indeed.

image

Each post is displayed as a card, showing the top four. And as an added bonus you can now also post using the web part.

image

If you however want the "classic” Yammer embed, there is an option in the web part to turn this on, but this does not work for all company. There is however a solution.

If you install my modern script editor web part from the PnP samples. You can paste the following Yammer embed script.

<script type="text/javascript" src="https://c64.assets-yammer.com/assets/platform_embed.js"></script>
    <div id="embedded-feed" style="height:500px;width:100%;"></div> 
<script type="text/javascript">
yam.connect.embedFeed({
"feedId" : "all",
  "config": {
    "use_sso": true,
    "header": false,
    "footer": false,
    "showOpenGraphPreview": false,
    "defaultToCanonical": false,
    "hideNetworkName": false,
    "theme": "light"
  },
  "container": "#embedded-feed"
});
</script>
image

With the result looking like you would expect, seeing each thread expanded with comments.

image

Happy Yamming!

No comments:

Post a Comment