Filtering dynamic content items in the backend grid by workflow status

Filtering dynamic content items in the backend grid by workflow status

August 30, 2012 0 Comments

The content you're reading is getting on in years
This post is on the older side and its content may be out of date.
Be sure to visit our blogs homepage for our latest news, updates and information.

Since the release of the module builder we've been asked number of times how to add filters to the dynamic items grid view. If you navigate to Content -> Dynamic Type in the sidebar there are only options to view "All" and "My" items which is not enough. Here I am going to show you how to enrich the sidebar in the content type page. For instance news can be filtered by their status – Draft, Unpublished and so on while dynamic items grid view doesn’t have these options. 

Fortunately workflow status filters can be easily added from Sitefinity Settings. To configure it navigate to Administration -> Advanced -> DynamicModules -> Telerik.Sitefinity.DynamicTypes.Model.CustomModule.CustomContentType -> Views -> CustomContentTypebackendList -> Sidebar -> Sections -> Filters -> Items. Create new CommandWidgetElement and set the following properties:

Command name: filter
Command argument: {filterExpression : "ApprovalWorkflowState = \"Draft\""}
Command button type: SimpleLinkButton
Name: DraftItems
CommandText: DraftItems
Type: Telerik.Sitefinity.Web.UI.Backend.Elements.Widgets.CommandWidget

Save and go to Content -> Dynamic Content Type. In the sidebar you can see the new filter and by clicking it the grid is updated only with draft items. To create and other workflow status filters just follow these steps and change the Command argument to:

Published items: {filterExpression : "ApprovalWorkflowState = \"Published\""}
Draft items: {filterExpression : "ApprovalWorkflowState = \"Draft\""}
Unpublished  items: {filterExpression : "ApprovalWorkflowState = \"Unpublished\""}
Scheduled for publishing items : {filterExpression : "ApprovalWorkflowState = \"Scheduled\""}

If you have one or two level workflow the following filters can be applied:

Awaiting approval items : {filterExpression : "ApprovalWorkflowState = \"AwaitingApproval\""}
Awaiting publishing items : {filterExpression : "ApprovalWorkflowState = \"AwaitingPublishing\""}

progress-logo

The Progress Guys

View all posts from The Progress Guys on the Progress blog. Connect with us about all things application development and deployment, data integration and digital business.

Comments
Comments are disabled in preview mode.
Topics
 
 
Latest Stories in
Your Inbox
Subscribe
More From Progress
d12fcc0bdb669b804e7f71198c9619a7
5 Questions Automakers Should Ask to Improve Asset Uptime
Download Whitepaper
 
SF_MQ_WCM
2018 Gartner Magic Quadrant Web Content Management (WCM)
Download Whitepaper
 
What-Serverless-Means-For-Enterprice-Apps-Kinvey
What Serverless Means for Enterprise Apps
Watch Webinar