4

I've set up an archive page as described in the docs... so my archive page url looks something like this http://mysite.dev/news/2014/09.

How do I then make the title display Archive for September 2014?

The {{ month }} variable is set as 09 and doing this -> {{ month|date("F") }} outputs January not September.

Any help would be appreciated.

markstewie
  • 395
  • 3
  • 10

1 Answers1

7

Figured out a way to do this if anyone who has the same problem.

    {% if year is defined and month is defined %}
    {% set archiveDate = year ~ '-' ~ month ~ '-01' %}
    <h2 class='archive-title'>Archive for {{ archiveDate|date('F') }} - {{ year }}</h2>
    {% endif %}
markstewie
  • 395
  • 3
  • 10