Newer Version Available
Reuse Content with CMS Connect JSON
Content Item or Content List?
Suppose that you want to reuse JSON content that’s in your CMS and display it in your community. CMS Connect supports two basic types of JSON content. What they’re called in one CMS can differ from what another CMS calls them. To keep things simple, in CMS Connect, we call them content item and content list.
An example of a content item is a single blog post. When it displays on a page, it’s the full blog post, not just a blurb about it. A content list, on the other hand, is a grouping of items, such as a series of blogs. When a content list displays on a page, you see a title and summary for each list item, with a link to the full blog.
How to Reuse JSON Content
The process boils down to three key steps.
- If needed, set up Cross-Origin Resource Sharing (CORS). If your CMS resources aren’t available to your community, add your community host to the trusted hosts in the CORS header of your CMS system. All CMS connections must use unauthenticated HTTPS (HTTP over SSL).
- Create a CMS connection. When you set up the connection, you define whether the content is a content item or a content list and specify the server URL and content paths.
- Add CMS Connect (JSON) components to your community pages. Using the Community Builder, drag the component to your community page and configure its properties. Use JSON expressions to bring in the title, author, blog content, and so on from your CMS.
Preview Your JSON Content
It helps to preview the JSON response body so that you understand the data format of your CMS system. For example, suppose that the URL for your WordPress website is https://capricornblog.wordpress.com. Enter the full JSON endpoint for the CMS content in a browser, for example, https://public-api.wordpress.com/rest/v1.1/sites/capricornblog.wordpress.com/posts.
You use this endpoint when you define the CMS connection. The endpoint has two parts: the server URL and a JSON path. In this example, the server URL points to a WordPress site, and the JSON path is the path for a set of blogs. When you configure a CMS Connect (JSON) component, you retrieve the blog series as a content list, and each individual blog as a content item.

When you enter the endpoint in a browser, you see the data format of the JSON response body. Previewing the response helps you understand how to configure the CMS Connect component on your community pages.

Example Drupal Responses
Example
Let’s say you have JSON content in a Drupal CMS. Here’s what the JSON response body for an example content item looks like.
In this example, @data points to the parent node. Attribute nodes for @data are nested below the parent.
When you configure a CMS Connect (JSON) component, use JSON expressions to specify the connection and content that you want to retrieve.
For example, this JSON expression pulls the title of the content.
This expression retrieves the content ID.
And this JSON expression retrieves the content body, for example, the blog text.
JSON expressions can handle any node depth.
Example
Here’s an example of a JSON content list in a CMS connection that uses Drupal. The path to the content list is {baseUrl}/jsonApi/node/page.
You can display JSON content from multiple sources on your community pages. Set up JSON connections in your CMS Connect workspace. Then drag components to your pages and define JSON expressions that pull in your CMS content.