This is the second part of the Sitecore – Social Media Integration Series. In this post we will look on how we can tweet a Sitecore page to Twitter from Content Editor.
It is very much similar to the previous post, where we published a Sitecore Page as a Facebook Post. This is just a follow up post, we would be developing components similar to the previous post, Setting up developer account, creating an app, getting the necessary permissions/keys/tokens, creating sitecore custom commands everything.
The only difference I felt while developing this component is Facebook uses OAuth2 were as Twitter API still uses OAuth1.
We are just laying the foundation for the Analytics SPEAK component which we would be creating later. We should get the analytics details of how a Sitecore Item is performing in twitter. For that the first step is to enable the Digital Marketing team to tweet a sitecore page via Content Editor. That’s what we will work on in this post.
It’s a three step process.
- We need to setup a Twitter App – using a Twitter Developer Account. This should be created with the related Twitter Handle to which we wish to tweet our page.
- Once the app is setup, we will get the necessary Keys/Tokens to access the twitter API, to post our Sitecore Page.
- We will work on creating our custom command in Default Context Menu that tweets the Page item.
Setting Up Twitter Developer Account and Keys/Tokens/Permission:
- Create a Twitter Developer Account using your twitter account. Once you created a Dev. Account, create an App. This App will be used for posting tweets.

- The App is needed to get the Access Token/API Key and it’s secret key. These values will be used for authorization while accessing the Twitter API.

- Another important point to note here is, we have setup the permission of this app clearly.

Creating Sitecore Items and the logic:
- I wouldn’t be walking through on the steps to create a custom command. For more details on this as already mentioned above refer this post.
- Here, I have made use of SEO Fields of a Page item and added them as Tweet captions. Of course we can create a separate Social Media Section and related field names Twitter Caption and make use of it.
- After adding the necessary menu items in Core DB, the corresponding class and creating the corresponding config patches,







In upcoming posts, we will work on setting up the analytics dashboard using Facebook Graph API or Twitter Analytics API that provides Analytics data of how this Sitecore page performs different social media platform.