Custom datetime for attribute

Author Message

paul bolger

Wednesday 25 April 2007 9:49:24 pm

I have a content class with an attribute 'date_of_meeting'. I'm trying to format the output:

{attribute_view_gui attribute=$node.object.data_map.date_of_meeting|datetime( 'custom', '%l %j %F %Y' )}

I've tried every permutation I can think of, but nothing seems to work. Can anyone help me out?

thanks

Paul Bolger
Alice Springs Town Council

Paul Bolger

Bruce Morrison

Wednesday 25 April 2007 11:24:47 pm

Hi Paul

Try (untested)

{$node.object.data_map.date_of_meeting.data_int|datetime( 'custom', '%l %j %F %Y' )}

P.S. Have a look at the default datatype view template for clues.

Cheers
Bruce

My Blog: http://www.stuffandcontent.com/
Follow me on twitter: http://twitter.com/brucemorrison
Consolidated eZ Publish Feed : http://friendfeed.com/rooms/ez-publish

paul bolger

Thursday 26 April 2007 7:24:03 pm

Hi Bruce. That works, thanks.

So, 'data_int' returns the system date string instead of the default formatted date?

regards
Paul Bolger

Paul Bolger

Bruce Morrison

Thursday 26 April 2007 8:25:42 pm

Hi Paul

So, 'data_int' returns the system date string instead of the default formatted date? 

Kind of. Different datatypes store their "raw" values in different places. "content" usually stores the data that is used for output.

As I mentioned, the default datatype view templates are a good source to find where info is stored and how it is displayed. the "attribute" template function is also a good way .e.g

{node.object.data_map.date_of_meeting|attribute(show,2)}

Cheers
Bruce

My Blog: http://www.stuffandcontent.com/
Follow me on twitter: http://twitter.com/brucemorrison
Consolidated eZ Publish Feed : http://friendfeed.com/rooms/ez-publish

paul bolger

Thursday 26 April 2007 11:10:07 pm

Ah yes, the 'attribute' function. I encountered that yesterday playing around with the weather extension (great idea, pity about the source data...)

Paul Bolger

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.