<p>The following three resources should be substantial enough to find a solution:</p>

<ul>
<li><a href="https://craftcms.stackexchange.com/questions/11508/linking-and-showing-archive-by-month">Linking and showing archive by month</a></li>
<li><a href="https://craftcms.com/support/entry-archive#grouping-by-year-and-then-month" rel="nofollow noreferrer">Craft Docs: Grouping by year and then month</a></li>
<li><a href="https://craftcms.stackexchange.com/questions/6541/need-to-access-year-month-variable-when-grouping-entries-by-date">Need to access year/month variable when grouping entries by date</a></li>
</ul>

CC BY-SA 3.0
2016-06-09T17:29:13.437Z
2016-06-09T17:29:13.437Z
2017-04-13T12:51:00.253Z
Luke Pearce
<p>This snippet displays every post by postDate, which lists a bunch of “October 2015”. I am trying to filter by month/year, so only one “October 2015” shows then one “November 2015”, then one “December 2015” so on and so forth. So choosing the month, shows all posts from that month. </p>

<pre><code>&lt;div class="form-field select"&gt;
&lt;label for="blog-date"&gt;by date&lt;/label&gt;
&lt;div class="custom-select"&gt;
    &lt;select name="blog-date" id="blog-date" onchange="window.location.href=this.value;"&gt;
        &lt;option value="/blog"&gt;All Time&lt;/option&gt;
        {% cache %}
        {% nav entry in craft.entries({ group: 'blog', order: 'postDate desc', limit: null }) %}
            &lt;option value="{{ entry.postDate | date('F-Y') }}"
                {% if craft.request.getLastSegment() == entry.postDate %}selected{% endif %}&gt;
                {{ entry.postDate | title | date('F Y') }}
            &lt;/option&gt;
        {% endnav %}
        {% endcache %}
    &lt;/select&gt;
&lt;/div&gt;
</code></pre>

<p></p>

<filter><postdate>
Dropdown that shows all months and when selected displays all entries from that month
# Dropdown that shows all months and when selected displays all entries from that month

(Asked by: username_0 on 2016-06-09)

This snippet displays every post by postDate, which lists a bunch of “October 2015”. I am trying to filter by month/year, so only one “October 2015” shows then one “November 2015”, then one “December 2015” so on and so forth. So choosing the month, shows all posts from that month. 

by date

    
        All Time
        {% cache %}
        {% nav entry in craft.entries({ group: 'blog', order: 'postDate desc', limit: null }) %}
            
                {{ entry.postDate | title | date('F Y') }}
            
        {% endnav %}
        {% endcache %}

**Tags:** filter, postdate

---

## 1 answers

### Answer by username_1 on 2016-06-09. Score: 1 | Accepted answer

The following three resources should be substantial enough to find a solution:

* [Linking and showing archive by month](https://craftcms.stackexchange.com/questions/11508/linking-and-showing-archive-by-month)
* [Craft Docs: Grouping by year and then month](https://craftcms.com/support/entry-archive#grouping-by-year-and-then-month)
* [Need to access year/month variable when grouping entries by date](https://craftcms.stackexchange.com/questions/6541/need-to-access-year-month-variable-when-grouping-entries-by-date)


---

