Forums / Setup & design / Creating an EZdate within an template, for customizing EZ demo blog calendar

Creating an EZdate within an template, for customizing EZ demo blog calendar

Author Message

Tore Skobba

Thursday 11 March 2004 1:35:45 am

Hi

I want to use the "EZ calendar" (monthview.tpl). As a source I am using the Blog example. However, instead of using it as an archive I would like to use it for forthcoming events. Therefore I have an "calendar folder" having several calendar_event (s) each having an Date field attribute. However, I am not managing to use the actual date in my fetch on attribute date(i.e. fetch all articles for an particular day). I belive this is because I do not know what I should compare the EZdata to? But since it is an EZdate I thought about fetching the current date, making an ezdate of that and then compare with it.

More specific below here:
I am customizing the "archive_navigatorbar.tpl" file in the blog example. Which has an fetch selecting all "log" grouped on which day they are "published". However I would like to group by my own date field instead of "published". But datafield is an EZ data and I cannot manage to check for dataes in my fetch sentence.

Orginal Code:
attribute_filter, array( and, array( 'published', '>=',maketime( 0, 0, 0,$today_info.month, 1, $today_info.year ) ),
array( 'published', '<=',maketime( 23, 59, 59, $today_info.month | inc, 0,$today_info.year ) ) ),

My wanted change:
attribute_filter, array( and, array( 'date', '>=',maketime( 0, 0, 0,$today_info.month, 1, $today_info.year ) ),
array( 'date', '<=',maketime( 23, 59, 59, $today_info.month | inc, 0,$today_info.year ) ) ),

But this does not work and gives me an SQL error.

UPDATE: I have solved the syntax problem now.. However, my idea of altering the temaplte was not correct. The SQL error was due to using the attribute name instead of the id. Once I changed date to its id it worked.
Cheers
Tore