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

Breadcrumb

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:

Views Module (in core)

Date Module (in core)

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

Create a date field in your upcoming event content type.

In your views settings, click add on the filter criteria option

Search for event date (or whatever you named your date field in content type)

Click apply (leave for all displays to be applied to all views display)

Richie is a website builder at KodeHauz. He loves Drupal and has launched many websites with it. His hobbies include: swimming, watching movies and TV series, writing, conducting and singing with the choir and, of course, writing codes.