Skip to main content
+234 803-795-2621
Drupal 8: How to hide upcoming events in views after event or specific date
Fri, 10/28/2016 - 15:02

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

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.
    Category
    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.

    Are you ready to take your business global?

    Request a quote
    click here.