Yearly archives
Posted: 29 January 2007 06:28 AM   [ Ignore ]  
Lab Assistant
Avatar
RankRank
Total Posts:  113
Joined  01-05-2007

Many blogs contain so few posts that monthly archives look a bit silly. EE should support archive links like

http://mysite.tld/index.php/template_group/year/

(without the month). This kind of link currently simply generates a blank page. Also, EE should support the following tag:

{exp:weblog:year_links}

which it currently doesn’t.

And before you suggest the “Yearly Archives” plug-in, have a look at what it really does.

Profile
 
 
Posted: 29 January 2007 07:33 AM   [ Ignore ]   [ # 1 ]  
Research Assistant
RankRankRank
Total Posts:  547
Joined  01-05-2005

Magnus, EE does support archive links like that.  You might need to include dynamic=“off” in your tag.  Example.

For the year_links tag, until your wish is granted, you could simply amend the month_links code.

{exp:weblog:month_links weblog="blog" limit="50"}

<a href="{path=sandbox/{year}}">{year}</a><br />

{/exp:weblog:month_links}

 Signature 

Celebrating again soon.

Profile
 
 
Posted: 29 January 2007 08:02 AM   [ Ignore ]   [ # 2 ]  
Research Assistant
RankRankRank
Total Posts:  547
Joined  01-05-2005

Actually scrap the using the month_links suggestion.  You’d just end up with multiple year links wouldn’t you.

 Signature 

Celebrating again soon.

Profile
 
 
Posted: 29 January 2007 08:19 AM   [ Ignore ]   [ # 3 ]  
Moderator
Avatar
RankRankRankRankRankRankRankRank
Total Posts:  32861
Joined  05-14-2004

I see what he’s saying. I thought just having the year would work as well, but EE treats it as an entry ID not a year, and so displays no entries - at least in my case. Not quite a blank page, though, just blank where the content would be.  So I would expect:

http://www.lisajill.net/dem/index/2007

to throw a year, but the content area is blank, because EE believes it to be an entry ID of 2007.  Having the / month there changes the context enough that EE does it by month.

Did I get that right, Magnus?

As to your issue with the yearly archives - what is it doing that you don’t like?  It would be far more beneficial to your request to be explicit in that.  I personally don’t have that plugin installed so am not entirely sure how it outputs its information and, therefore, what you dislike about its behavior.  Certainly you could put together a plugin for this functionality, though.

 Signature 
Profile
MSG
 
 
Posted: 29 January 2007 09:17 AM   [ Ignore ]   [ # 4 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  113
Joined  01-05-2007

smallbeer, thanks for your input, I can see that your example works but I cannot make it work on my site.

The first problem I have is the “dynamic=off” parameter. Since there is no exp:weblog:year_links tag, I don’t understand how I can use the exp:weblog tag at all (which is where I assume you want the “dynamic=off” parameter placed)? So can you please show me the template source for the example you provided?

Lisa, yes you right, the page isn’t blank, it just doesn’t contain any entries.

I have nothing against the Yearly Archives plug-in except that it doesn’t provide yearly archives. It is a list generator for year/month combinations that can be fed into the Weblog Module to obtain monthly archives. I just wanted to point out in advance that regardless of its name it has nothing to do with the solution my problem.

Profile
 
 
Posted: 29 January 2007 09:23 AM   [ Ignore ]   [ # 5 ]  
Research Assistant
RankRankRank
Total Posts:  547
Joined  01-05-2005

Sure.  The code to filter by year is…

{exp:weblog:entries weblog="blog" year="{segment_2}" dynamic="off" limit="10"}
{title}
<br />
{if no_results}
None
{
/if}
{
/exp:weblog:entries}

 Signature 

Celebrating again soon.

Profile
 
 
Posted: 29 January 2007 12:59 PM   [ Ignore ]   [ # 6 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  113
Joined  01-05-2007

So how do you generate the archive links in the sidebar, do you just hard-code the years in a list, linked to a template with the code to filter by year?

Profile
 
 
Posted: 29 January 2007 01:14 PM   [ Ignore ]   [ # 7 ]  
Moderator
Avatar
RankRankRankRankRankRankRank
Total Posts:  12390
Joined  04-29-2002

You could do it via a query, where you’d get back the right years to use.

SELECT distinct year FROM `exp_weblog_titles`

would do that for you.

 Signature 

Quick Reference - EE Trial Options - EE Wiki - Docs for updating a build

Profile
MSG
 
 
Posted: 29 January 2007 02:10 PM   [ Ignore ]   [ # 8 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  113
Joined  01-05-2007

But then we’d be quite far from

EE does support archive links like that

wouldn’t we. In my world, “EE does support” and “you need to hard-code most of it and use some raw SQL” are opposites. It seems we can drop these circumvention discussions and simply agree that EE currently does not support yearly archives.

<ul>
{exp:weblog:year_links weblog="news" sort="desc"}
<li>{year}</li>
{/exp:weblog:month_links}
</ul>

The above handles the whole issue exactly like monthly archives, but per year. It generates the links and does the filtering at the same time. Pretty neat and very flexible, compared to the solutions we’ve been discussing here so far.

The real question is of course if there’s anyone more than me that wants this support added to the product.

Profile
 
 
Posted: 29 January 2007 02:18 PM   [ Ignore ]   [ # 9 ]  
Moderator
Avatar
RankRankRankRankRankRankRank
Total Posts:  12390
Joined  04-29-2002

Magnus, I never said that EE supports yearly archives natively. I just chimed in one method of getting back a listing of the years in the exp_weblog_titles table.

The real question is of course if there’s anyone more than me that wants this support added to the product.

Dunno. You’ve got the request in the right place. I suppose a plugin could be created to do this. Do I need it? Not normally. Most of my clients don’t blog or need that sort of functionality.

 Signature 

Quick Reference - EE Trial Options - EE Wiki - Docs for updating a build

Profile
MSG
 
 
Posted: 29 January 2007 04:07 PM   [ Ignore ]   [ # 10 ]  
Research Assistant
RankRankRank
Total Posts:  547
Joined  01-05-2005

Magnus you’ve got two seperate feature requests going on here.  it was me who said EE does support what you want.  At least the first part.  You asked whether EE could filter entries based on the sort of link you suggested.  I said yes it can.  Which it can.

Magnus Wester - 29 January 2007 06:28 AM

Many blogs contain so few posts that monthly archives look a bit silly. EE should support archive links like

http://mysite.tld/index.php/template_group/year/

(without the month). This kind of link currently simply generates a blank page.

 Signature 

Celebrating again soon.

Profile
 
 
Posted: 04 March 2007 01:27 PM   [ Ignore ]   [ # 11 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  436
Joined  02-02-2006

Magnus, I created a simple plugin that spits out the years of all entries in a specified blog (using a parameter). I can post it if it will be of use to you. It’s basically a similar query that Sue posted but in plugin form.

 Signature 

Learn EE step-by-step with the ExpressionEngine Screencasts

Ryan Irelan

Profile
 
 
   
 
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 1149, on July 16, 2007 09:33 AM
Total Registered Members: 64939 Total Logged-in Users: 66
Total Topics: 81912 Total Anonymous Users: 36
Total Replies: 440330 Total Guests: 272
Total Posts: 522242    
Members ( View Memberlist )