Grouping dates in behaviour

I’m trying to make a behaviour that takes some events with dates from
a ‘showings’ table and puts them on the page.

For events on the same day I only want to show the date once, like this:

Monday
some event
some other event
and yet another event

Tuesday
You get the idea

I’m not sure how to do this…

The behaviour looks like this:

tag “showings:coming” do |tag| content = ‘’
@showings = Showing.all

@showings.each do |showing|
tag.locals.showing = showing
content << tag.expand
end
content
end

tag “showing” do |tag|
tag.expand
end

tag “showing:date” do |tag|
tag.locals.showing.start.strftime("%m/%d/%Y")
end


Jeroen

jeroen janssen wrote:

Tuesday
You get the idea

Have a look at the children:each:header tag in page_context.rb:

http://dev.radiantcms.org/radiant/browser/trunk/radiant/app/models/page_context.rb

You could easily create something similar for your “showings” tags.


John L.
http://wiseheartdesign.com