ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Nesting Month Links by Year

January 13, 2009 1:10pm

Subscribe [2]
  • #1 / Jan 13, 2009 1:10pm

    compass360

    13 posts

    I’d like to have my archive links nested in this manner:

    2009
    <div id="months">
    January
    </div>
    
    2008
    <div id="months">
    October
    September
    March
    </div>

    I know that it’s possible to use the {year_header} tag to enclose the {year} as well as the container DIVs for the months, but without a sort of {year_footer} I have no way of closing them.

    {exp:weblog:month_links weblog="entries" limit="50"}
    {year_heading}
    {year}:<br>
    {/year_heading}
    <a href="http://{path=current/archives}">{month}</a><br>
    {/exp:weblog:month_links}


    Is there a way that anyone knows of enclosing the months like this?

  • #2 / Jan 13, 2009 4:52pm

    compass360

    13 posts

    Solved my own question with the help of the Yearly Archives plugin.

    {exp:yearly_archives weblog="news|reviews" sort="desc"}
    {if entries_in_year > 0}
    {year}:<br>
    <div id="months">
    {months}
    <a href="http://{path=current/archives}">{month}</a><br>
    {/months}
    </div>
    {/if}
    {/exp:yearly_archives}
  • #3 / Sep 27, 2013 1:03pm

    hellodaylight

    26 posts

    I must revive this one - There is still no year_footer tag in the Archive Month Links - and this post was written back in 2009 for EE 1. Someone had the though of adding a year_header, but for some strange reason not a year_footer. We should not have to rely on yet another plugin to do something so simple. There are date headers and footers in the channel tags, so why not here?!

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases