More in this section

Forums / Developing with Sitefinity / DynamicContent: different between Visible and ApprovalWorkflowState properties

DynamicContent: different between Visible and ApprovalWorkflowState properties

2 posts, 0 answered
  1. Michael
    Michael avatar
    3 posts
    03 Mar 2014
    09 Jun 2014
    Link to this post


    How would the data returned using this:

    listOfDynamicContentItems.Where(x => x.Visible == true);

    differ to this:

    listOfDynamicContentItems.Where(x => x.ApprovalWorkflowState = "Published");

    Thank you, Michael

  2. Sabrie Nedzhip
    Sabrie Nedzhip avatar
    534 posts
    17 Aug 2017
    11 Jun 2014
    Link to this post
    Hello Michael,

    If you filter the dynamic content items or any content item by their ApprovalWorkflowState property as following:

    listOfDynamicContentItems.Where(x => x.ApprovalWorkflowState = "Published");

    you will get both the master version of the content item which is not visible on the frontend and the live version - which is visible on the frontend.

    If you would like to get only the published live version of the items you need to filter the items as following:

    listOfDynamicContentItems.Where(x => x.Visible &&  x.ApprovalWorflowState == "Published");

    You may also refer to the following documentation articles for more details on content lifecycle and types of statuses:
    1. Types of statuses
    2. Content Lifecycle

    Sabrie Nedzhip
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Sitefinity CMS Ideas&Feedback Portal and vote to affect the priority of the items
2 posts, 0 answered