Filtering Popular Posts on Drupal: How to Filter by Time Frame with Views

| Drupal Development | 27 seen

In a previous tutorial, I showed how to use Views to filter popular posts on a Drupal site. Today, I will demonstrate how to filter popular posts within a specific time frame, such as a week or a month.

Note that this tutorial will only apply filters to the most viewed nodes based on their publishing date, not to all nodes within a certain time frame.

If you haven't already set up a popular blog post View, please refer to the link above and follow the steps to create your View.

To begin, open your popular blog post View and add a new filter under the "Filter" section. Select "Content: Post date" and choose "Operator: is between" in the filter settings.

In the "Min" field, enter the time frame you want Drupal to filter, for example, if you want to filter posts from the last 10 days, enter "-10 days" as the offset. In the "Max" field, enter the current time to ensure that future posts are not included in the filter.

If you have any questions or issues with this process, please leave a comment below and I will be happy to assist you.

 

Latest articles

Why I Sold Put Options on Lufthansa Stock (LHA) – Earning 14.5% Annualized Yield

Recently, after booking a trip to Ireland with Lufthansa, I found myself taking a closer look at the company's stock.As I commented on LinkedIn:"Another interesting European stock to play with is Lufthansa (LHA). After booking a trip to Ireland with them, I decided to sell some short put options on the stock. As long as it doesn't go belly up,…

Options trading |

Titanic Chaussee Hotel in Berlin

At the start of April 2026, we spent about six nights at Titanic Hotel Berlin (Chausseestraße 30). The trip was primarily work-related—my fiancée attended a conference in the translation industry—but it turned into a relaxed family stay, as I tagged along with our child during the Easter school break.The hotel sits in a convenient part of Berlin…

Germany |