drupaldrupal-viewsdrupal-exposed-filter

Drupal 7: Exposed filter on a post date


I have couple hundreds of articles on a website. I use a view to show excerpts and links to them on one page and I also have a pager that show 10 articles at the time. I need to add a dropdown with years [...,2008,2009...,2013]. If you select a year in the dropdown, then view should only display articles that were posted in that year. Years in the dropdown should be updated automatically if a new article added in 2013 for example, and thus the first year is the year of the first publication.

Please suggest possible solutions.


Solution

  • I think, you need to set exposed filter to the view list. The configuration should be something like--

    Filter criteria: Date (node);

    Form element: Select;

    Filter granularity: Year;

    Date Fields: Post Date; Expose;

    Filter type to expose: Single;

    Operator: equal to;

    Inform me if it works..