Kentico CMS 7.0 Developer's Guide

Autoposting

Autoposting

Previous topic Next topic Mail us feedback on this topic!  

Autoposting

Previous topic Next topic JavaScript is required for the print function Mail us feedback on this topic!  

From Kentico CMS, you can post messages to Facebook and Twitter accounts directly from CMS Desk or the on-site editing interface.

 

You have the following options how to publish content from within the editing interface to Facebook or Twitter. Each of them is suitable for a different situation.

 

If you want to post information about documents of one specific document type, either manually, or automatically at the time of publishing, choose Publishing to Facebook or Twitter using form controls.

If you want to post information about a certain section of the content tree, regardless of the document type, choose Publishing to Facebook or Twitter using a workflow step.

 

In both these cases, you post to the chosen social network from within the interface where you edit a document. You can use macros in the message you post. For example, you can use macros to insert the URL of the document into the message.

 

Connecting the application to Facebook

 

Before you can post from Kentico CMS to Facebook, you must authorize the application to use your Facebook account. See Registering your application.

 

Connecting the application to Twitter

 

Before you can post tweets from Kentico CMS, you must authorize the application to use your Twitter account.

 

1. Go to http://dev.twitter.com and log in.

 

2. Create a new application.

 

3. Navigate to your application's Settings and select Read and Write under Application Type -> Access.

 

4. Switch back to Details and under Your access token, create your access token.

 

5. Paste the following information into Kentico CMS, Site Manager -> Settings -> Social networks -> Twitter.

Consumer key

Consumer secret

Access token

Access token secret

 

6. On Twitter, navigate to your application's Settings and select Read and Write under Application Type -> Access.

 

The system is now configured to post to Twitter.

 

Automatic publishing to Facebook or Twitter using a workflow step

 

You can post messages to social networks as part of a document's workflow process using the Publish to Facebook and Publish to Twitter workflow steps. You can use this approach to automatically publish information about documents in a section of your site's content. If you want to write a message and publish it to social networks directly from the document editing interface, consider Publishing to Facebook or Twitter using form controls.

 

1.Configure the application for connecting to Facebook or connecting to Twitter.

 

2.Create an advanced workflow with the Publish to Facebook or Publish to Twitter step.

 

An example workflow process with publishing to Twitter

An example workflow process with publishing to Twitter

 

3.Set the Text of the message which will be automatically posted to Facebook/Twitter in the Workflow step properties. You can use macros in the message.

For example, Check out our new blog post at www.example.com{% GetDocumentURL() %}. The resulting URL could then look like this: www.example.com/blog/my-latest-blog-post.aspx

 

4.Create a document using this defined workflow.

When advancing over the Publish to Facebook/Publish to Twitter step in the workflow, the predefined message will be automatically posted.

 

Publishing to Facebook or Twitter using form controls

 

By adding the Facebook auto post and Twitter auto post form controls to a document type, you can enable editors to post messages to social networks from the document editing interface. You can also allow choosing whether to post the message right away or after the document gets published.

 

1.Configure the application for connecting to Facebook or connecting to Twitter.

 

2.Insert the Facebook auto post/Twitter auto post form control into the required document type.

You can do this in Site Manager -> Development -> Document types -> Edit the chosen document type -> Fields tab -> New attribute (NewAttribute). Choose Text as attribute type and choose a sufficient attribute size (at least 140 is recommended).

If you plan on using workflow on this document, add "autopost" as suffix to the column name.

 

3.Create a document of the modified type in CMS Desk.

 

4.Save the document.

 

5.Type a message into the Post at Facebook/Post at Twitter field. You can use macros.

Note that the message can be only 140 characters long on Twitter.

 

6.Click the Post at Facebook/Post at Twitter button, or check Post at Facebook/Twitter after publishing (if using workflow) and save the document.

The system posts your message on a corresponding social network.

If the Post after publishing checkbox is on, the system will post your message once you publish the document.

 

Posting a link to an article to Twitter and Facebook on the Form tab in CMS Desk

Posting a link to an article to Twitter and Facebook on the Form tab in CMS Desk