The Year Listing plugin is a simple way to return a list of years in which there are entries in a weblog.
For better markup control, the {count} and {total_results} variables can be used, exactly the same way as in {weblog:entries} tag.
Example usage:
{exp:yearlist weblog="yourWeblog" category="1"} {year} {/exp:yearlist}
<ul> {exp:yearlist weblog="yourWeblog" category="1"} <li{if count == total_results} class="last"{/if}>{year}</li> {/exp:yearlist} </ul>
That will return an array of years. Use {year} to print them to the screen and wrap in any markup needed. There are currently no linebreaks or HTML associated with this plugin.
The category parameter is optional and if you leave it out, the plugin will search across all categories.
This plugin will only work on ExpressionEngine 1.6.8. I also have YearList 2.0 available for ExpressionEngine 2.0.