Drupal 8: How to hide upcoming events in views after event or specific date

Posted by richienabuk on October 28, 2016

 

Best use cases to hide upcoming events in views after event or specific date in Drupal 8 would be creating an upcoming event views block and page without the Calendar module. After the event has passed, it's necessary for the event to be unpublished from views display.

I want to assume you know how to create content types, add fields and create views blocks and pages.

    Views Module in Drupal CMS is one of the most popular and powerful tool in building website with Drupal.

    Requirement:

    1. Views Module (in core)
    2. Date Module (in core)

     

    To make event post automatically hide in views display after event date or specified date:

     

    1. Create a date field in your upcoming event content type.
    2. In your views settings, click add on the filter criteria option
    3. Search for event date (or whatever you named your date field in content type)
    4. Click apply (leave for all displays to be applied to all views display)
    5. In the operator region, select is greater than, value type: now.
    6. Click Save.

    Drupal 8: How to hide upcoming events in views after event or specific date

    Now, after the specified upcoming event date, the content will disappear from the views block and/or pages.

     

     

    Looking for Web Designer, Developer and Content Administrator?

    Request a Quote