Share » Forums » Setup & design » Customize calendar.tpl. Fetching...

Customize calendar.tpl. Fetching content by a date field attribute instead of the default published. How to ?

Customize calendar.tpl. Fetching content by a date field attribute instead of the default published. How to ?

Saturday 25 September 2004 4:54:30 am - 10 replies

Modified on Saturday 25 September 2004 5:22:57 am by laurent le cadet

Author Message

laurent le cadet

Monday 27 September 2004 11:58:36 pm

Is it possible or not ? I really stuck on this....

Paul Borgermans

Tuesday 28 September 2004 12:09:51 am

No,

But there is a contribution which does this:

http://ez.no/community/contributions/applications/agenda_v1_0

It is for including in templates for node views (not pagelayout.tpl, that needs some tweaking)

hth

-paul

eZ Publish, eZ Find, Solr expert consulting and training
http://twitter.com/paulborgermans

laurent le cadet

Tuesday 28 September 2004 12:17:32 am

Thanks Paul,

Your answer is really clear.
I already had a look at Stefano's template without a great success. I'm going to try again to make it works.

Laurent.

Tore Skobba

Tuesday 28 September 2004 1:26:01 am

Hi

Use the Agenda, it is more flexible then EZ calendar view, the later I find very difficult to use and adapt.. I like the idea very much but I think it is currently to complex and lacking documentation to be of any good use.

For an example of an adapted agenda see: www.grunderskolen.no and alumni.grunderskolen.no

Cheers
Tore

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

Tuesday 28 September 2004 8:06:10 am

headhach...

I stuck on printing out the agenda result, what and where ?

<b>"Create a new override for results"</b> <i>Stefano</i>

I tryed turning on the debug to print which template is call to display the result of the agenda event but no info.
I tested wiew/full or line whithout ant result.

May I have some help or where can I fund a more consistent doc ?

It's a case of emergency before a nervous breakdown...(look at me on your right)

Laurent

Tore Skobba

Wednesday 29 September 2004 2:32:07 am

You need to do an node override in order to display the agenda template code.. I.e in:

settings/siteaccess/YOURDESIGN/override.ini.append

add something like this:
[agenda]
Source=node/view/full.tpl
MatchFile=node/view/agenda.tpl
Subdir=templates
Match[node]=NODE_NUMBER , the node number of the content object which holds all the calendar events

laurent le cadet

Wednesday 29 September 2004 3:16:11 am

Hello Tore,

It was already done (full and line) but without the node ID...I add the line, claer all caches, but no way :(

Actually :

- the agenda display links from the first event record with the date_from attribute till the end of the month.
- the links relative to the day I created events (not the date_from attribute) show agenda view as lines
- previous/next buttons jump to the home page

It's a new step (line view) but still not really efficient.

Do you have another idea ?

Laurent.

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.

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu