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.

Archive News by Year

June 21, 2007 4:06pm

Subscribe [2]
  • #1 / Jun 21, 2007 4:06pm

    stevo_s

    176 posts

    Hi,

    I’m trying to create sidelinks that will link to a page of news items by the year -

    2007
    2006
    2005

    etc.,

    Not sure what should be in my url links for each yr   -

    {exp:weblog:entries weblog="news" orderby="date" sort="desc"}
    {date_heading display="yearly"}
    <li><a href="http://{news/???">{entry_date format="%Y"}</a></li>
    {/date_heading}
    {/exp:weblog:entries}


    Do I need to create a new template for the yearly archives?

    What would the main body entries code in that page then look like ?

    {exp:weblog:entries weblog="news" orderby="?????"  }
    <h2>{title}</h2>
    <p>{entry_date format="%F %d %Y"}<br />
    {news_main_summary}<br />
    <a href="http://{title_permalink=">Read Full Story</a><br />
    {/exp:weblog:entries}

    (newbie to EE)

  • #2 / Jun 21, 2007 5:52pm

    stevo_s

    176 posts

    I think I’ve got it having found this page -http://expressionengine.com/wiki/Yearly_Archives/

    I don’t have loads of entries yet to test this but see what you think -

    I created new template ‘year’

    with

    <h2>Archive for the year {segment_3}</h2>
    <p>{exp:weblog:entries weblog="news" dynamic="off" year="{segment_3}" sort="asc"} </p>
    
    <p>{date_heading display="monthly"} </p>
    
    <h4>{entry_date format="%F %Y"}</h4><p> <br />
    {/date_heading} </p>
    
    <p>{/exp:weblog:entries}


    then sidebar links in main index page -

    {exp:weblog:entries weblog="news" orderby="date" sort="desc"}
    {date_heading display="yearly"}
    <li><a href="http://{path=weblog/year}">{entry_date format="%Y"}</a></li>
    {/date_heading}
    {/exp:weblog:entries}


    sound right?

    I just want the year page to list all the entries for that year .

    How would I paginate that big year list?

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

ExpressionEngine News!

#eecms, #events, #releases