« ROME 1.0 RC2 on the... | Main | More about Fauxcoly »

Eclectic Roller hacks

Sun's CTO for UK and Ireland, Wayne Horkan, is a bit of a Roller hacker, and I mean that in the nicest way possible ;-) His blog has always been a showcase for what you can do with Roller template programming, although recently he has adopted a more simple and clean design. Wayne just posted a set of three interesting and useful Roller hacks on his blog Eclectic:
  • New next-previous macro: this one is useful for showing a reader where they are in a blog, which post they are reading and the names of the next and previous posts; sorta like the "current location" sidebar in Greg Reimer's theme.
  • Related entries: this is designed for use on an individual entry page and shows entries that are related to the entry being viewed based on tag and category relationships. This is an especially good hack because the code is a little scary; it iterates through the most recent 1000 posts in the entry's category, then the most recent 1000 entries in any category and then it does some analysis. I suspect this gives blogs.sun.com a bit of a workout, but it's serving four million hits/day at 97% idle so that should be no problem, no?
  • Archive macro: this one shows a blogger.com-like list of links to recent month's entries. Would be a little nicer if it displayed a count of entries for each month, but I don't think that's possible with Roller's current template system and models.

Nice stuff. Have you got any Roller hacks to share?


Testing 1 2 3...

Posted by Dave Johnson on January 13, 2009 at 01:51 AM EST #

Hi Dave,

Cheers for this; it was nice of you to write it up.

Re: Related Entries - I've changed the code based on your comments so it only grabs the last 100 entries of the same category and then the last 20 entries of the other categories to analyse. Obviously this can be changed by editing #set ($cycleEntriesTotal = 100) to whatever is felt appropriate.

I've also removed all redundant variables, fixed a bug due to non-allocation of variables, and changed the sort code so that it keeps date and time based precedence (so entries with the same number of matches will remain in date and time sequence).

Rather than repost I've retconned the code example into the article; the old code is still there, but hidden in a non-displayed <div> code block at the end.

All the best,


Posted by Wayne Horkan on January 13, 2009 at 06:14 AM EST #

Post a Comment:
  • HTML Syntax: NOT allowed

« ROME 1.0 RC2 on the... | Main | More about Fauxcoly »


This is just one entry in the weblog Blogging Roller. You may want to visit the main page of the weblog

Related entries

Below are the most recent entries in the category Roller, some may be related to this entry.