Boyinks4Adventure - Blog Archives
Blog archives are typically pretty straightforward affairs - but in this case I was using a WooTheme for the site that was written for WordPress. The page has a few features that aren’t straight out of the box with ExpressionEngine, so I wanted to see how hard it would be to replicate them.
Here is my finished product - you can see that I was able to re-create the main page functionality. This was mostly straightforward with general-purpose EE tags, with the exception of a couple things. I’ve provided a text version of the template - open that and let’s work through the page:
The Last 30 Posts
This is an easy one - just a weblog:entries loop with a limit of 30.
Categories
EE has a Weblog Categories tag that will return category links for the specified weblog - but what EE doesn’t provide is a native way to get the count of entries in each category. There are a few ways to do this - like you could write a custom query using the Query Module. I chose to use a 3rd party plugin called Entries Number by the somewhat mythical Laisvunas (almost 50 addons listed for EE!). I wrapped {exp:entries_number} tags with {exp:weblog:categories} tags so I could feed entries_number the category_id and get it to return the count.
Monthly Archives
Same story here - EE has a Monthly Archives tag - but it doesn’t return a count. In this case I did chose to do a custom query that uses the year and month values provided by the native month_links EE tag pair.
So with a quick custom query, a plugin, and some native tags - I was able to replicate the provided design in pretty short order.
Category Navigation





by Ryan Battles
Date: Tuesday, June 22nd, 2010
Comment: #1
I find it funny that EE doesn’t provide a native way to count archives or categories, as it has its roots as a blogging platform. However, thanks be to the add-on developers or a little custom queries to pull out what you need. For an EE2 site I am building, I’ve just used Zac Gordon’s Category Count and Low’s Yearly Archives add-ons to get the results I needed.