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:
-
Create an action to start the state flow.
-
Create the blog approval trigger.
-
Change the CMP approval trigger.
Create an action to start the state flow
To create an action to start the state flow:
-
On the menu bar, click Manage .
-
Click Actions.
-
On the Actions page, click New action.
-
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
-
Click Save.
Create the blog approval trigger
To create the blog approval trigger:
-
On the menu bar, click Manage .
-
Click Triggers
-
Click New trigger.
-
On the Conditions tab, enter the following:
-
Name - an identifiable name for the trigger (mandatory). In this example, we enter Blog - content approval trigger.
-
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.
-
Objective: the objectives of the trigger (mandatory). In this example, we select:
-
Entity creation
-
Entity modification
-
-
Execution type - the execution type of the trigger (mandatory). In this example, we select In process.
-
-
Click Save.
-
On the Conditions tab, click Add definition and select M.Content.
-
Click + Condition, create the condition: Approved for creation (Content.ApprovedForCreation) | current value | equals, and turn the switch to On.
-
Click + Condition, create a second condition: Type (ContentTypeToContent) | current value | contains | all | Blog.
-
Check that the two conditions are related using the and operator.
-
Click Save.
-
On the Actions tab, scroll down to Post actions and click Add action.
-
Select the start state machine action created previously.
-
Click Save and close.
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:
-
On the Triggers page, scroll down to CMP - Content approval trigger.
-
Click View details .
-
Select the Conditions tab.
-
Click + Condition.
-
Add a condition of; Type (ContentTypeToContent) | current value | does not contain | all | Blog.
-
Click Save and close.