[Tb] agents for news section

From: Mark Smith <mark__AT__bbprojects.net>
Date: Sat Jan 22 2005 - 10:06:05 EST

I'm still fairly green with agents and could use a tip for this:

I'm working on a web site and am struggling a bit with a planned news secti=
on.

The relevant parts of my Tinderbox file look like this:

        News
                Recent News
                News Archive
                        Categories
                                Category A
                                Category B
                                etc.
                        Monthly
                                Jan
                                Feb
                                etc.
        Posts
                Post 1
                Post 2
                etc.
               =20
               =20
"News" is a "page" which has its children ("Recent News" and "News Archive"=
) as a list of links. The individual posts will have their own pages, but t=
hese will only be provided by permalinks on their own pages, they will not =
be explicitly navigable via major site links. This is the reason for the hi=
erarchical structure of my file and the source of some of my as yet unsolve=
d problems.

I'm looking for agent queries for certain pages:

1. "News"

2. "Recent News"

3. The individual Category pages e.g. "Category A"

4. "Monthly"

----=20

1. "News" : Should gather the single newest child of "Posts". (The title, c=
reation date and full text will be included in the "News" page in addtion t=
o its child links ("Recent News" & "News Archive".)

2. "Recent News" : Should gather a specified number (probably 3 to 6) of th=
e newest additions to "Posts". (The titles and creation dates of these will=
 be displayed as a list in the "Recent News" page.)

3. "Category" : Should gather all entries in Posts with "category" attribut=
e contents =3D to the name of the note (e.g. Category A). (These will be di=
splayed on the individual category pages in the same way as entries are lis=
ted on the "Recent News" page.

        (I can solve an easy variant of this one if I make an agent per cat=
egory (as you would hope), but I'm looking for a general agent that collect=
s notes with category attribute contents equal to its own name (if you see =
what I mean).)

4. "Monthly" should gather those children of "Posts" with a creation date f=
alling inside of a given month. I've got a working cludge for this, but it =
requires the first and last dates of each month and there must be a better =
way to do it. For extra points, I'd like children of "Monthly" to be genera=
ted on the fly. For example, when I make the first post in e.g. Feb 2005, a=
 new child of "Monthly" should be created named e.g. Feb 2005, and the post=
 should be aliased there. (Not sure if this is possible in Tinderbox as it =
stands.) (The display will be a list of Note names (one per archive month) =
as links on the "Monthly" page. Each month linked from there will have a li=
st of its child notes as title and creation date.)

My problem with 1 and 2 is finding the correct combination of syntax to get=
 the "newest/youngest" child[ren] of "posts" according to creation date.

I might be hoping for too much wrt 3 and 4 and have to settle for the basic=
s that I can get working already, but I figured its worth asking.

wtia,

mark.
Received on Sat Jan 22 15:06:05 2005

This archive was generated by hypermail 2.1.8 : Wed Dec 14 2005 - 10:45:38 EST