Filtering dynamic content items in the backend grid by workflow status

Filtering dynamic content items in the backend grid by workflow status

Posted on 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 Team

View all posts from The Progress Team 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

Sitefinity Training and Certification Now Available.

Let our experts teach you how to use Sitefinity's best-in-class features to deliver compelling digital experiences.

Learn More
Latest Stories
in Your Inbox

Subscribe to get all the news, info and tutorials you need to build better business apps and sites

Loading animation