0

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.

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

seth
  • 117
  • 1
  • 8

1 Answers1

1

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

Luke Pearce
  • 3,863
  • 1
  • 11
  • 25