I'm trying to create an archive list template that lists entries from a News or Blog Channel based on year/month/day combinations.
However, I get no entries and can't see where I'm going wrong...I'm running the latest build of Craft.
{% if year is not defined %}
{% redirect "news/archives/"~now.year %}
{% endif %}
{% set year = craft.request.segment(3) %}
{% set month = craft.request.segment(4) %}
{% set day = craft.request.segment(5) %}
Year: {{ year }}<br>
Month: {{ month }}<br>
Day: {{ day }}<br><br>
{% if (year | length) and (month | length) and (day | length) %}
{% set entryDate = year ~ '-' ~ month ~ '-' ~ day %}
{% elseif (year | length) and (month | length) %}
{% set entryDate = year ~ '-' ~ month %}
{% elseif (year | length) %}
{% set entryDate = year %}
{% endif %}
Entry Date: {{ entryDate }}<br><br>
{% set entries = craft.entries.find({section: "news", postDate: entryDate}) %}
{% if entries | length %}
Entries found.
{% else %}
No entries found.
{% endif %}