Connect Your Content Management System to Your Salesforce Community using CMS connect
You can connect your CMS content to your community for consistent branding, reuse of material, and ease of maintenance. There are so many CMS available outside in the market. The noted once are WordPress and Blogger. Today in this blog post we will check how to get the content from your CMS.
Famous Third party CMS:
- Adobe Experience Manager
- Drupal its show time
- Google Blogger
- Sitecore
- WordPress etc..
What Is CMS Connect?
CMS Connect lets you embed assets from a third-party CMS in your Salesforce community. You can connect CMS components, HTML, JSON, CSS, and JavaScript to customize your community.
Before using CMS Connect please go through below prerequisites.
https://help.salesforce.com/articleView?id=communities_cms_connect_prerequisites.htm&type=5
Keep in mind that all the above-mentioned points are taken care before you will start with CMS connect.
CMS Connect uses Cross-Origin Resource Sharing (CORS) to access external content. Make sure to add Community Host to the list of trusted hosts in the CORS header in your CMS system.
This means that you need to set up your blog in the CORS section in Setup.
- To do this go to Setup – Security Controls – CORS or you can go to Setup and search for CORS in the quick find.
- Click the New button
- Enter your blog domain. You can either enter the domain itself or use a wildcard if you have a subdomain.
For this blog post, I have taken https://shrutisridharan.wordpress.com WordPress site and added to CORS list Now its Show Time 😛
Integrate WordPress into Communities Using CMS Connect JSON:
- Open your Community–> Go to Community Builder–>Builder Icon( Top Left )–>CMS Connect.
- Click New CMS Connection Provide Name, CMS Source, Connection Type, Server URL, Add JSON as mentioned in the Screenshot below.
- Content Item:
Name: Blog Item
Path: rest/v1.1/sites/shrutisridharan.wordpress.com/posts/{component}
ID Path: ID
Title Path: title - Content LIST:Name: Blog Feed
Path: rest/v1.1/sites/shrutisridharan.wordpress.com/posts
You can use extra query parameters to specify how many records you want to pull by giving ?number={itemsPerPage}
To know more about query parameters go through WordPress documentation.
Node Path: posts - Click Save
Now its time to use newly created CMS Connection in our Community.
- Click on the Down Arrow on the right side of Connection–> Use In Builder
- From the components panel drag and drop CMS Connect(JSON) on to community builder space. Now when you click on the component you will see properties of the component
Select the properties as shown in the below screenshots.
So observe here that I have mapped name field with @author/name as the JSON response is having the same way if we come from posts node. posts node is the part where we are getting all the content. Kindly note that I have provided value as “posts” in NODE PATH while setting value in CONTENT LIST.
- Click Save. BOOM!!!! Click On Read More link to view the content in your Community. Please check here
Awesome! Your community is now configured to display your WordPress blog posts.
Integrate Google Blogger into Communities Using CMS Connect JSON:
- Open your Community–> Go to Community Builder–>Builder Icon( Top Left )–>CMS Connect.
- Click New CMS Connection Provide Name, CMS Source, Connection Type, Server URL, Add JSON as mentioned in the Screenshot below.
- Content Item:
Name: Blog Item
Path: blogger/v3/blogs/1043722254592848650/posts/{component}?key=AIzaSyC9oDrfTGaI0zj7Xd1MYRpBX0LJW_VCpfc
ID Path: id
Title Path : title
Here 1043722254592848650 is Blog ID - Content LIST:Name: Blog Feed
Path: blogger/v3/blogs/1043722254592848650/posts?key=AIzaSyC9oDrfTGaI0zj7Xd1MYRpBX0LJW_VCpfc&fetchBodies=true&maxResults=50&fetchImages=true
You can use extra query parameters to specify how many records you want to pull by giving maxResults=50
To know more about query parameters go through Blogger documentation.
Node Path: items - Click Save
Now its time to use Blogger CMS Connection in our Community.
- Click on the Down Arrow on the right side of Connection–> Use In Builder
- From the components panel drag and drop CMS Connect(JSON) on to community builder space. Now when you click on the component you will see properties of the component
- Select the properties as shown in the below screenshots.
Here I gave query parameters to pull the image and didn’t get images to need to check that, observe that id is in small. We need to map those values exactly how they are present in the response.
If you go and try here https://developers.google.com/blogger/docs/3.0/reference/posts/get still I am getting response and images also coming. - Click Save. BOOM!!!! Click On Read More link to view the content in your Community. Please check here
Final output
There are other CMS system available you can try and connect with them.
Resources:
- https://help.salesforce.com/articleView?id=communities_cms_connect.htm&type=5
- https://developer.salesforce.com/docs/atlas.en-us.communities_dev.meta/communities_dev/communities_dev_cms_example_json.htm
- https://developer.salesforce.com/blogs/2018/06/integrate-external-content-into-communities-using-cms-connect-json.html
Let me know if you face any difficulties while implementing CMS Connect!! Cheers !!!
Comments
9 Comments
Have you done the SFDC Community integration with Drupal? if so, can you please share an example.
Hello @KaeCarmen,
i don’t have a active Drupal website for testing.
Thanks.
How to do this step-
“Make sure to add Community Host to the list of trusted hosts in the CORS header in your CMS system.”
The description of this step is about adding CORS in Salesforce but it should be other way around.
Bro.. you are awesome
Hi Bro,
I need to make a connection of WordPress rest API posts on cms connection community page, I have been searching for this for a long time, but I could not make it, please help me on this
Hello Vinoth,
Can you be more specific what’s your use case?
BR,
Saicharan
Hello I have a question Im not too familiar with word press, but is it possible to create a WordPress site that could manage a Users Account in WP and then can I use CMS to see some of that information in salesforce. The use case would be to get around buying community licenses
Hi, Very helpful blog post.
I am getting an error
“The server returned code HTTP 0.”
I have added url in CORS, CSPS, Remote site settings.
Any Idea? Do we also need to set CORS or CSPs in WordPress?
Thanks.>!
Never got that error Vaibhav. I don\’t think we can set CORS or CSP in WordPress.
Leave a Comment