laurent le cadet
|
Saturday 25 September 2004 4:54:30 am
Hi, I'm trying to use the calendar.tpl, which work fine but what I need is to fetch the the content of a specific node with an attribute instead of the published date.
I created a class with a date field, let us call it "publication_date".
I think it's possible to sort by attribute but I just don't know how. I presume the date field use the same structure as the published date (2000,00,00) so I change the 'published' by the date field attribute ID (here it's '187'):
{let log_node=fetch( content, node, hash( node_path, $show_subtree ) )
show_week=false()
month_list=fetch( content, tree, hash( parent_node_id, $log_node.node_id,
class_filter_type, include,
class_filter_array, array( 'agenda' ),
attribute_filter, array( and, array( '187', '>=',
$time_start ),
array( '187', '<=',
$time_end ) ),
group_by, array( "published", "day" ),
as_object, false() ) )
month=$month_list|month_overview( 'published', $time_published,
hash( current, $time_current,
current_class, 'selected',
today_class, 'today',
link, $log_node.url_alias,
month_link, true(), year_link, true(), day_link, true(),
next, hash( link, $log_node.url_alias ),
previous, hash( link, $log_node.url_alias ) ) )}
{include name=Month uri="design:navigator/monthview.tpl" month=$month show_week=$show_week}
{/let}
But it still working the same way.
Or maybe we have to change the $time_published : time_published=maketime( 0, 0, 0, $today_info.month, $today_info.day, $today_info.year ) Someone has an idea ? Laurent
|
laurent le cadet
|
Tuesday 28 September 2004 2:19:21 am
Hi Torre,
I managed to reproduce the calendar as you did on alumni.grunderskolen.no by including Stefano template in a pagelayout. First step (Champaign !). But I have few problems :
- I can't print out the result (content/view/full/...). Stefano told about a fetch instruction that way :
{let temp_ts=makedate( $view_parameters.month, $view_parameters.day, $view_pa
rameters.year )
events=fetch( 'content', 'list', hash( 'parent_node_id', 247,
'attribute_filter',
array( 'and',
array( 'event/date_from', '<=', $temp_ts
),
array( 'event/date_to', '>=', $temp_ts )
) ) ) }
...but I don't know how to use it. - The previous/next buttons jump to the home page - All the days of the current month between the first event and the end of the month are show as a link (even if there is no event). I'm lost a little...
|
laurent le cadet
|
Wednesday 10 November 2004 10:58:16 am
Hi (and sorry) to be back again, I stopped for a while the site I work on (I was making a CD-ROM), and I'm back again with the calendar V1.
I feel very stupid and frustrate that I can't not achieve this part by myself.
The calendar works very well (date_from, date_to) but the I don't know how to write the template which is call. I tryed this :
{let temp_ts=makedate( $view_parameters.day, $view_parameters.month, $view_parameters.year )
events=fetch( 'content', 'list', hash( 'parent_node_id', 63, 'attribute_filter', array
( 'and', array( 'agenda/date_from', '<=', $temp_ts), array( 'agenda/date_to', '>=', $temp_ts ) ) ) ) }
{section name=eventsLoop loop=$events}
{node_view_gui view=element content_node=$eventsLoop:item}
{/section}
{$temp_ts}
{/let}
You can see I try also to print out $temp_ts but it's only = "-1"... Someone can copy/paste here his own .tpl ? Thanks. Laurent
|
Bjarte Lunde
|
Thursday 13 January 2005 7:06:10 am
Hi Laurent...
I'm working with adapting this template myself. I want the week to start on monday. Here is the code i'm using to show the contents of an event:
{let counter=0
temp_ts=makedate( $view_parameters.month, $view_parameters.day, $view_parameters.year)
events=fetch( 'content', 'list', hash( 'parent_node_id', 880,
'attribute_filter',array( 'and',array( 'event/date_from', '<=', $temp_ts),array('event/date_to', '>=',$temp_ts )) ) ) }
{section loop=$:events}
{set counter=$:counter|inc}
<h2>{$:item.object.data_map.title.content|wash}</h2>
{$:item.object.data_map.body.content.output.output_text}
{/section}
{/let}
My body field is a XML Text field. You might need to modify this a bit.
|