Socialcast Learn About Socialcast

Dynamic Extension

A Dynamic Extension uses variables on the host page to determine which type of extension to display and what content to include. You can use either JavaScript or the Open Graph Protocol (OGP) to pass one or more variables to the Dynamic Extension. Based on the variable types and content, the Dynamic Extension determines what data to display.

Currently, you can create three types of Dynamic Extensions: group streams, profile streams, and group discussions. Be aware that you must have access to a group in order to use it in an extension.

How It Works

From the user’s point of view, a Dynamic Extension looks just like an ordinary Stream or Discussion Extension. The difference is that you can create a single extension that changes its type and content based on the page where it’s located. For example, you might create a Dynamic Extension that displays a department group stream on a department page. The same extension could display a different group stream on each department page.

Dynamic Extension

Security: During the configuration process you can restrict access to a Dynamic Extension by requiring users to log in before the information appears on the page.

Unique Configuration Instructions

To create a Dynamic Extension, follow the instructions in Setting up a Reach Extension. There are no special configuration fields for this particular extension type. However, you will need to implement one of two schemes for passing variable data to the Dynamic Extension:

  • Use Open Graph Protocol (OGP) metadata on the host page. The Dynamic Extension will automatically detect any metatags that are present on the host page and use the value to find the associated stream or discussion.
  • Use the Reach JavaScript API to add options to the Reach Extension definition object itself. These options will override any variables found in the OGP metadata.

For a Profile Stream

To display a profile stream, you must supply an email address.

If you’re using OGP, place the og:email tag on the page containing the extension. For example:

<html prefix="og: http://ogp.me/ns#">
<head>
<meta property="og:email" content="emily@socialcast.com" />
…
</head>
…
</html> 

If you’re using the JavaScript API, add the email option to the Reach Extension definition object.

For a Group Stream or Discussion scoped to a Group

To display a group stream or discussion scoped to a Group, you must supply either a group ID or a group name.

If you’re using OGP, place the og:group_name tag or the og:group_id tag on the page containing the extension. For example:

<html prefix="og: http://ogp.me/ns#">
<head>
<meta property="og:group_name" content="Sales Team" />
…
</head>
…
</html>

or

<html prefix="og: http://ogp.me/ns#">
<head>
<meta property="og:group_id" content="1" />
…
</head>
…
</html>

Using the JavaScript API, add the group_id or group_name option to the Reach Extension definition object.