Link previews in Slack and MS Teams for Confluence pages?

John Price
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 1, 2021

When I paste links from our company Confluence Data Center site (uses SSO) into Microsoft Teams or Slack, there's no nice link preview ("unfurl" in Slack terms) with a page title and description.  I spent a couple of hours figuring out how to add Facebook's commonly used "og" meta tags to the Velocity template, but the link previews don't work.  I finally realized this is probably due to authentication:  Teams/Slack cannot fetch the content without some credentials, either mine or something baked into Teams.  

Is there some clever way around this?  BTW if it helps anyone, here's code I added to the Main Layout in Confluence.  I did not find, frankly, any useful docs on how to reference specific properties and did a lot of trial and error.  The URL bit isn't right but I'm stuck anyway ... 


 ## BEGIN LINK PREVIEW TAGS
<meta property="og:type" content="website" />
<meta property="og:url" content="$req.getServerName()" />
<meta property="og:title" content="$sitemeshPage.getProperty("title")" />
<meta property="og:description" content="$sitemeshPage.getProperty("title")" />
<meta property="og:image" content="$req.getServerName()$spaceManager.getLogoForGlobalcontext().getDownloadPath() " />
## END LINK PREVIEW TAGS  

 

1 answer

0 votes
Brant Schroeder
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 27, 2022

@John Price Unfortunately it will only pull the main space image and description and there is no way to adjust this.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events