[Tb] agents for news section

From: Benoit Pointet <info__AT__e.gramme.ch>
Date: Mon Jan 24 2005 - 03:16:20 EST

> 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.
>
>
> "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 these 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 hierarchical structure of my file and the
> source of some of my as yet unsolved 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"
>
> ----
>
> 1. "News" : Should gather the single newest child of "Posts". (The
> title, creation date and full text will be included in the "News" page
> in addtion to its child links ("Recent News" & "News Archive".)

News cannot gather and contain original (= not alias) notes.

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

query: #inside(Posts)
sort by: Created

in "News", or its template, specifiy:
^justChildren(recentnewstemplate,3) to export the 3 most recent posts
(not sure of that)

> 3. "Category" : Should gather all entries in Posts with "category"
> attribute contents = to the name of the note (e.g. Category A). (These
> will be displayed on the individual category pages in the same way as
> entries are listed on the "Recent News" page.
>
> (I can solve an easy variant of this one if I make an agent
> per category (as you would hope), but I'm looking for a general agent
> that collects notes with category attribute contents equal to its own
> name (if you see what I mean).)
>

query: #inside(Posts)&category=^title(this)

> 4. "Monthly" should gather those children of "Posts" with a creation
> date falling 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 generated 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 list of its
> child notes as title and creation date.)

1. on the fly creation don't seem possible by now.
2. a solution is to create the next 12 months once for all, by then
you'll have another idea/solution.
3. i think your "working cludge" is the solution.

> 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
> basics that I can get working already, but I figured its worth asking.
>

best regards

b.
Received on Mon Jan 24 08:16:20 2005

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