We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Yearly Archives plugin

Development and Programming

Low's avatar
Low
407 posts
19 years ago
Low's avatar Low

With this plugin you can easily set up yearly archives. You could consider it an alternative to the Archive Month Links Tag or the existing workarounds. Tested with EE version 1.4.1 build 20060217.

Download the plugin from my site. The docs are there, too.

       
Linda A's avatar
Linda A
647 posts
19 years ago
Linda A's avatar Linda A

Is it possible to get it to entirely skip years without any entries? 😊

       
Low's avatar
Low
407 posts
19 years ago
Low's avatar Low

Now it is. 😊

       
Linda A's avatar
Linda A
647 posts
19 years ago
Linda A's avatar Linda A

Thank you 😊

There may be a little bug with this, though. It works, but before it loads the proper page, it loads this for a while:

Notice: Undefined index: 1990 in /home2/sites/westeros.org/www/html/Scripts/ExpressionEngine/system/plugins/pi.yearly_archives.php on line 90

Notice: Undefined index: 1996 in /home2/sites/westeros.org/www/html/Scripts/ExpressionEngine/system/plugins/pi.yearly_archives.php on line 90

Notice: Undefined index: 1997 in /home2/sites/westeros.org/www/html/Scripts/ExpressionEngine/system/plugins/pi.yearly_archives.php on line 90

etc for each year

       
Low's avatar
Low
407 posts
19 years ago
Low's avatar Low

Ack! My fault for wanting to implement things too quickly. Hang on a sec…

       
Low's avatar
Low
407 posts
19 years ago
Low's avatar Low

Couldn’t reproduce the Notices, but it should be fixed now, methinks.

       
Linda A's avatar
Linda A
647 posts
19 years ago
Linda A's avatar Linda A

Yup, looks fixed. 😊

Thank you so much for the quick addition & fix.

       
Leslie Camacho's avatar
Leslie Camacho
1,340 posts
18 years ago
Leslie Camacho's avatar Leslie Camacho

Can anybody confirm that this works with 1.4.2? It appears to be messing up the years, which chokes the entry count. And yes, weblog1 is the correct weblog shortname. lol. Thanks.

For example, this code:

<ul class="yearly_archives"> 
{exp:yearly_archives weblog="weblog1" start_month="1" status="not closed” 
sort="desc"} 
<li> 
{if leap_year == 1}<em>{year}</em>{if:else}{year}{/if} 
<ul>{months} 
<li> 
{if num_entries > 0} 
<a href="http://{path=blog/archive}{year}/{month_num}/" title="{num_entries} entries in {month} {year}">{month_short}</a> 
{if:else} 
{month_short} 
{/if} 
</li>{/months} 
</ul> 
</li> 
{/exp:yearly_archives} 
</ul>

returns:

<li>
2
<ul>
<li>
<a href="http://example.com/index.php/home/archives/2/01/" title="0 entries in January 2">Jan</a>
</li>
<li>
<a href="http://example.com/index.php/home/archives/2/02/" title="0 entries in February 2">Feb</a>
</li>

<li>
<a href="http://example.com/index.php/home/archives/2/03/" title="0 entries in March 2">Mar</a>
</li>
<li>
<a href="http://example.com/index.php/home/archives/2/04/" title="0 entries in April 2">Apr</a>
</li>
<li>
<a href="http://example.com/index.php/home/archives/2/05/" title="0 entries in May 2">May</a>
</li>
<li>
<a href="http://example.com/index.php/home/archives/2/06/" title="0 entries in June 2">Jun</a>
</li>
<li>

<a href="http://example.com/index.php/home/archives/2/07/" title="0 entries in July 2">Jul</a>
</li>
<li>
<a href="http://example.com/index.php/home/archives/2/08/" title="0 entries in August 2">Aug</a>
</li>
<li>
<a href="http://example.com/index.php/home/archives/2/09/" title="0 entries in September 2">Sep</a>
</li>
<li>
<a href="http://example.com/index.php/home/archives/2/10/" title="0 entries in October 2">Oct</a>
</li>
<li>
<a href="http://example.com/index.php/home/archives/2/11/" title="0 entries in November 2">Nov</a>

</li>
<li>
<a href="http://example.com/index.php/home/archives/2/12/" title="0 entries in December 2">Dec</a>
</li>
</ul>
</li>

</ul>
       
Low's avatar
Low
407 posts
18 years ago
Low's avatar Low

Strange. My archives work just fine and I use practically the same code. Are you using the plugin inside some other tag, perhaps? Additional questions: what version of the plugin are you using (1.0 or 1.1)? What version of php are you running?

       
Sue Crocker's avatar
Sue Crocker
26,054 posts
18 years ago
Sue Crocker's avatar Sue Crocker

I’m using 1.1 version of the plugin.. with modified CSS from Chris’ CSS.

Yearly Archives Test

       
Leslie Camacho's avatar
Leslie Camacho
1,340 posts
18 years ago
Leslie Camacho's avatar Leslie Camacho
Strange. My archives work just fine and I use practically the same code. Are you using the plugin inside some other tag, perhaps? Additional questions: what version of the plugin are you using (1.0 or 1.1)? What version of php are you running?

I’m using the Yearly Archives 1.1 plugin, EE 1.4.2 build 20060530, php 4.3.2 on pM Hosting. The tag is on a page by itself, no other tags present.

I don’t have a URL to show you because at the moment my whole site is offline (in the middle of a big overhaul). Its Ruzin site that inspired trying this out.

I’ve tried removing the conditionals and stripping everything out (including all the html) except the basic year and month stuff, but same issue. It looks like the year is being messed up.

Are you guys on EE 1.4.2? Kinda sounds like it.

       
Leslie Camacho's avatar
Leslie Camacho
1,340 posts
18 years ago
Leslie Camacho's avatar Leslie Camacho

Lodewijk, I’d be happy to give you temp super-admin access to my site if that helps.

       
Sue Crocker's avatar
Sue Crocker
26,054 posts
18 years ago
Sue Crocker's avatar Sue Crocker
Are you guys on EE 1.4.2? Kinda sounds like it.

Yup. Build 20060612

PHP Version 4.4.2 - The vendor upgraded earlier.

On another site with 4.3.11

Testing again

       
Leslie Camacho's avatar
Leslie Camacho
1,340 posts
18 years ago
Leslie Camacho's avatar Leslie Camacho

Well, not sure what’s up. I upgraded to the latest build and same issue. I tried specifying different weblogs as well but no dice.

       
Sue Crocker's avatar
Sue Crocker
26,054 posts
18 years ago
Sue Crocker's avatar Sue Crocker

It’s just you. 😊 Seriously, I’m using the same code you are in a standalone template.

Yearly Archives Wiki Entry

       
1 2

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.