Thursday, April 14, 2016

Yammer Macro for Confluence

Yammer is a wonderful enterprise social tool and Confluence is a wonderful enterprise Wiki.  For a while I've searched for a native Yammer Confluence integration or a user macro for embedding Yammer into Confluence.  There's been some discussion on the Confluence boards, but none of the suggestions appear to work properly unless you enable the Confluence HTML macro.

Yammer's embed code works fine with the Confluence HTML macro, but it doesn't work in the cloud version and it's a security risk to give every user on your server permission to insert HTML/JavaScript code into your pages. For example, it opens you up to cross-site scripting attacks. So instead, I wanted to write a user macro that would allow users to embed their own Yammer newsfeeds on demand.

The issue is related to the way that Confluence handles scripting in user macros.  Unfortunately, Confluence seems to assume that you're using XHTML 1.x in your macros and so the native Yammer integration doesn't work. You get an error because Confluence wraps <![CDATA[]]> tags around your JavaScript code which breaks Yammer's JavaScript. This is leftover legacy from the days of the browser wars when everyone had their own standard and you had to hide incompatible code from older browsers.



So, without further ado, here is the macro:

Parameters:

  1. Macro Name: yammer-group-newsfeed
  2. Visibility: Visible to all users in Macro Browser (optional)
  3. Macro Title: Yammer Group Newsfeed
  4. Categories: External Content
  5. Icon URL: http://a2.mzstatic.com/us/r30/Purple6/v4/15/8a/92/158a924e-72fa-e678-2afe-284f6ea1b39f/icon175x175.jpeg
  6. Documentation: https://developer.yammer.com/docs/embed
  7. Macro Body Processing: Rendered


No comments:

Post a Comment