Nested archives

I’d like to create a what might be called a nested archive:

  • Server Maintenance
    ++ Web Server
    ++++ Post 1.1
    ++++ Post 1.2
    ++ Email Server
    +++ Post 2.1
    +++ Post 2.2

Browsing to “Server Maintenance” would show me the latest articles in
all
the subtrees (say Post 1.1 and Post 2.1).

Browsing to “Email Server” would only show me those articles collected
therein.

I get a little strangeness, and probably more to come, implementing as
shown.

In particular, I wonder what r:children in “Server Maintenance” will do
when
confronted with each of the sub-archives (ie “Web Server” and “Email
Server”).

Am I better off implementing as:

  • Server Maintenance
    ++ <r:aggregate “Web Server” “Email Server”>
  • Web Server
    ++ Post 1.1
    ++ Post 1.2
  • Email Server
  • Post 2.1
  • Post 2.2

Earl


Moody friends. Drama queens. Your life? Nope! - their life, your story.
Play Sims Stories at Yahoo! Games.

Earl,

Sorry I didn’t get to your message sooner. Figures that the week John
goes without email, we get flooded with messages to the list!

The default behavior of the Archive page is to organize its child pages
in a date-based URL fashion. It seems from your setup that the publish
date of the Web Server and Email Server pages is not significant, but
the publish date of their children are. Since you’re already using the
aggregation extension, you’d want a setup like this:

  • Server Maintenance (do your r:aggregate tag in this page)
    ++ Web Server
    +++ Post 1.1
    +++ Post 1.2
    ++ Email Server
    +++ Post 2.1
    +++ Post 2.2

The key to showing all the latest articles of all the subtrees is to
order the aggregated children in descending order by publish date:

<r:children:each order=“desc” by=“published_at” limit=“10”>…

I do that on my weblog: http://seancribbs.com/weblog . Here’s the code I
use:

<r:aggregate urls="/tech; /music; /philosophy">
<r:children:each order=“desc” limit=“6”>

Posted in | Continue reading...

Notice that /weblog is not even the parent of the primary sections;
r:aggregate makes no such requirement.

Cheers,

Sean

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs