Forums / Developer / Calendar events not showing up

Calendar events not showing up

Author Message

meriam santos

Sunday 30 August 2009 4:51:40 pm

Hi there,

i have used the calendar template and created my own event class named - event_maintenance.

originally its working so i thought all i need to change is the class name from event to event maintenance. after i have done this it wont show up the event on the calendar. would sombody please tell what i missed?

here are the settings that i have.

[events_maintenance_line]
Source=node/view/line.tpl
MatchFile=line/events_maint.tpl
Subdir=templates
Match[class_identifier]=event_maintenance

[events_maintenance_full]
Source=node/view/full.tpl
MatchFile=full/events_maint.tpl
Subdir=templates
Match[class_identifier]=event_maintenance

[is_calendar]
Source=node/view/full.tpl
MatchFile=is_calendar.tpl
Subdir=templates
Match[node]=147842

and here is the fetch statement that i used

is_calendar_month.tpl

{set $my_ts=makedate( $month, $number, $year )
$events=fetch( 'content', 'list', hash(
'parent_node_id', $events_node,
'attribute_filter', array( 'and',
array( 'event_maintenance/date_from', '<=', $my_ts ),
array( 'event_maintenance/date_to', '>=', $my_ts ) ) ) ) }

is_calendat_items.tpl

{*
a=fetch event starts before check day AND
end event ends after check day

b=fetch event starts on check day OR
event ends on check day
*}

{* condition a *}
{def $events=fetch( 'content', 'list',
hash( 'parent_node_id', $events_node, 'attribute_filter',
array( 'AND', array( 'event_maintenance/date_from', '<', $time_stamp),
array( 'event_maintenance/date_to', '>', $time_stamp )
)
)
)
}

{include uri="design:is_calendar_display.tpl"}


{* condition b *}
{def $events=fetch( 'content', 'list',
hash( 'parent_node_id', $events_node, 'attribute_filter',
array( 'or', array( 'event_maintenance/date_from', '=', $time_stamp),
array( 'event_maintenance/date_to', '=', $time_stamp )
)
)
)
}

{include uri="design:is_calendar_display.tpl"}

it does not display the event that i have created.

can somebody please tell me what i missed?

would really appreciate any reply..

cheers.......

meriam santos

Monday 31 August 2009 1:27:04 pm

Can somebody help me on this please...

André R.

Friday 04 September 2009 1:13:45 pm

Step back your steps and make sure you do one change at time.
Or debug your code by simplifing the filters (incl class and parent node filters) untill you see you actually get some data.

Use this for debugging:

{$some_variable|attribute('show', 2)}

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom

meriam santos

Sunday 20 September 2009 7:50:32 pm

Thanks Andre for the reply...

meriam santos

Moderated by: Nicolas Pastorino

Thursday 05 November 2009 7:16:28 pm

i have a question on your Agenda template. can you help me please on how to display only the weeks events rather that the whole months event.. really appreciate any reply. in case you need the code of agenda here it is. {* Agenda Folder override *}{set-block scope=root variable=cache_ttl}500{/set-block}{* Agenda v2.2.2 (C) 2006 by André R. Based on Agenda v1.0: (C) 2004 by Stefano Guandalini - nizan sg@nizan.net http://www.nizan.net And Agenda "v1.1":Modified 2006 by Per-Espen Kindblad This file may be distributed and/or modified under the terms of the "GNU General Public License" version 2 as published by the Free Software Foundation and appearing in the file LICENSE included in the packaging of this file. For changlog, install and other info see readme.txt in orginal package on ez.no: http://ez.no/community/contribs/applications/agenda_2_based_on_the_work_of_stefano_guandalini_and_per_espen_kindblad For discussion, problems and Contributions: http://ez.no/community/forum/developer/about_agenda_2_contribution*}{def$event_node=$node.node_id$curr_ts=currentdate()$curr_today=$curr_ts|datetime( custom, '%j')$curr_year=$curr_ts|datetime( custom, '%Y')$curr_month=$curr_ts|datetime( custom, '%n')$temp_ts=cond( and(ne($view_parameters.month, ''), ne($view_parameters.year, '')), makedate($view_parameters.month, cond(ne($view_parameters.day, ''),$view_parameters.day, eq($curr_month, $view_parameters.month), $curr_today, 1 ), $view_parameters.year), currentdate() )$datearray=gettime($temp_ts)$temp_month=$temp_ts|datetime( custom, '%n')$temp_year=$temp_ts|datetime( custom, '%Y')$temp_today=$temp_ts|datetime( custom, '%j')$days=$temp_ts|datetime( custom, '%t')$first_ts=makedate($temp_month, 1, $temp_year)$dayone=$first_ts|datetime( custom, '%w' )$last_ts=makedate($temp_month, $days, $temp_year)$daylast=$last_ts|datetime( custom, '%w' )$span1=$dayone$span2=sub( 7, $daylast )$dayofweek=0$day_array = " "$loop_dayone = 1$loop_daylast = 1$day_events = array()$loop_count = 0}{if ne($temp_month, 12)} {set $last_ts=makedate($temp_month|sum( 1 ), 1, $temp_year)}{else} {set $last_ts=makedate(1, 1, $temp_year|sum(1))}{/if}{def$events=fetch( 'content', 'list', hash('parent_node_id', $event_node,'sort_by', array( 'attribute', true(), 'event/from_time' ),'class_filter_type', 'include', 'class_filter_array', array( 'event' ),'main_node_only', true(), 'attribute_filter',array( 'or',array( 'event/from_time', 'between', array( sum($first_ts,1), sub($last_ts,1) )),array( 'event/to_time', 'between', array( sum($first_ts,1), sub($last_ts,1) )) )))$url_reload=concat("/content/view/full/", $event_node,"/day/",$temp_today,"/month/",$temp_month,"/year/",$temp_year, "/offset/2")$url_back=concat("/content/view/full/", $event_node, "/month/", sub($temp_month, 1), "/year/", $temp_year)$url_forward=concat("/content/view/full/", $event_node, "/month/", sum($temp_month, 1), "/year/", $temp_year)}{if eq($temp_month, 1)}{set $url_back=concat("/content/view/full/", $event_node,"/month/", "12", "/year/", sub($temp_year, 1))}{elseif eq($temp_month, 12)}{set $url_forward=concat("/content/view/full/", $event_node,"/month/", "1", "/year/", sum($temp_year, 1))}{/if}{foreach $events as $event}{if eq($temp_month|int(), $event.data_map.from_time.content.month|int())}{set $loop_dayone = $event.data_map.from_time.content.day}{else}{set $loop_dayone = 1}{/if}{if eq($temp_month|int(), $event.data_map.to_time.content.month|int())}{set $loop_daylast = $event.data_map.to_time.content.day}{else}{set $loop_daylast = $days}{/if}{for $loop_dayone|int() to $loop_daylast|int() as $counter}{set $day_array = concat($day_array, $counter, ', ')}{*check and add to day events while we already have the days*}{if eq($counter,$temp_today)}{set $day_events = $day_events|append($event)}{/if}{/for}{/foreach}

<< {$temp_ts|datetime( custom, '%F' )|upfirst()} {$temp_year} >>
Mon Tue Wed Thu Fri Sat Sun
   

{elseif eq( $number, $temp_today )}

{elseif and(eq( $number, $curr_today ), eq($curr_month, $temp_month))}

{else}

{/if}{if $day_array|contains(concat(' ', $number, ',')) } {$number}{else} {$number}{/if}

{if and( eq( $number, $days ), $span2|gt( 0 ), $span2|ne(7))}

{/if}{if or( eq( $dayofweek, 0 ), eq( $number, $days ) )}

Selected DayToday

{$temp_ts|datetime( custom, '%F %Y' )|upfirst()}:

{foreach $events as $event}{if and( ne($view_parameters.offset, 2), eq($loop_count, 8))}Show All Events..{/if}{if gt($curr_ts , $event.object.data_map.to_time.content.timestamp)}

{$event.name|wash}

{$event.data_map.category.class_content.options[$event.data_map.category.value[0]].name}
{$event.object.data_map.from_time.content.timestamp|datetime(custom,"%j %M")|shorten( 6 , '')}{if and($event.object.data_map.to_time.has_content, ne( $event.object.data_map.to_time.content.timestamp|datetime(custom,"%j %M"), $event.object.data_map.from_time.content.timestamp|datetime(custom,"%j %M") ))} - {$event.object.data_map.to_time.content.timestamp|datetime(custom,"%j %M")|shorten( 6 , '')}{/if}
{section show=$event.object.data_map.text.has_content} {$event.object.data_map.text.content|shorten( 110 , '...' )}{/section}

{/if}

{if eq($curr_ts|datetime( custom, '%j'),$temp_ts|datetime( custom, '%j'))}

Today:

{else}

{$temp_ts|datetime( custom, '%M %j')|upfirst()}:

{/if} {foreach $day_events as $day_event}{if gt($curr_ts , $day_event.object.data_map.to_time.content.timestamp)}{else}{/if}

{$day_event.name|wash}

Category: {$day_event.data_map.category.class_content.options[$day_event.data_map.category.value[0]].name}
{$day_event.object.data_map.from_time.content.timestamp|datetime(custom,"%j %M %H:%i")} {if $day_event.object.data_map.to_time.has_content} - {$day_event.object.data_map.to_time.content.timestamp|datetime(custom,"%j %M %H:%i")}{/if}{/foreach}

{undef $events $day_events}