Walkthrough: create a blog content state flow

Sitecore Content Hub has one standard state flow for content creation in its Content Management Platform (CMP). However, if you need a state flow for different content types, such as blogs, you need to create them.

The following example demonstrates how to mirror the CMP state flow. The result is a new state flow that handles blog content, replacing the default state flow applied to other content types.

Name

State changes

To Do

Start moves to In progress.

In progress

In progress moves to In review.

In review

Approve moves to Ready to publish or Reject moves to In progress.

Ready to publish

Ready to publish moves to Archive or Start over moves to To Do.

Archive

Unarchive moves to Ready to publish.

To create and trigger a state flow for blogs:

  1. Create an action to start the state flow.

  2. Create the blog approval trigger.

  3. Change the CMP approval trigger.

Create an action to start the state flow

To create an action to start the state flow:

  1. On the menu bar, click Manage manage icon.

  2. Click Actions.

  3. On the Actions page, click New action.

  4. In the New action dialog, fill in the following fields:

    Field name

    Description

    Example value

    Mandatory

    Name

    Enter a name for the new action.

    Blog content approval action

    Yes

    Label

    Enter an appropriate label for the new action.

    Blog content approval action

    No

    Type

    The type required.

    Start state machine

    No

    State flow

    Select the state flow with which this action should be associated.

    Blog flow created previously.

    Yes

  5. Click Save.

Create the blog approval trigger

To create the blog approval trigger:

  1. On the menu bar, click Manage manage icon.

  2. Click Triggers triggers icon

  3. Click New trigger.

  4. On the Conditions tab, enter the following:

    1. Name - an identifiable name for the trigger (mandatory). In this example, we enter Blog - content approval trigger.

    2. Description - a description of the trigger (optional). In this example, we enter Automatically starts the blog flow, which manages the states that blogs take from being an idea approved for creation to finally archived at the end of their life cycle.

    3. Objective: the objectives of the trigger (mandatory). In this example, we select:

      • Entity creation

      • Entity modification

    4. Execution type - the execution type of the trigger (mandatory). In this example, we select In process.

  5. Click Save.

    new trigger for blog content approval
  6. On the Conditions tab, click Add definition and select M.Content.

  7. Click + Condition, create the condition: Approved for creation (Content.ApprovedForCreation) | current value | equals, and turn the switch to On.

  8. Click + Condition, create a second condition: Type (ContentTypeToContent) | current value | contains | all | Blog.

  9. Check that the two conditions are related using the and operator.

  10. Click Save.

    new trigger for blog content approval added conditions
  11. On the Actions tab, scroll down to Post actions and click Add action.

  12. Select the start state machine action created previously.

  13. Click Save and close.

    new trigger for blog content approval added actions

Change the CMP approval trigger

As we now have a trigger that handles the approval of blogs in CMP, we need to change the default CMP - Content approval trigger so that it does fire for blogs, and continues to fire for all the other content types.

To change the default CMP - Content approval trigger:

  1. On the Triggers page, scroll down to CMP - Content approval trigger.

  2. Click View details view details icon.

  3. Select the Conditions tab.

  4. Click + Condition.

  5. Add a condition of; Type (ContentTypeToContent) | current value | does not contain | all | Blog.

  6. Click Save and close.

    edited cmp content approval trigger so not to fire for blogs

Do you have some feedback for us?

If you have suggestions for improving this article,