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.

eZ debug

Timing: Jan 19 2025 00:25:45
Script start
Timing: Jan 19 2025 00:25:45
Module start 'layout'
Timing: Jan 19 2025 00:25:45
Module start 'content'
Timing: Jan 19 2025 00:25:46
Module end 'content'
Timing: Jan 19 2025 00:25:46
Script end

Main resources:

Total runtime0.9269 sec
Peak memory usage4,096.0000 KB
Database Queries63

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0055 587.9141152.6250
Module start 'layout' 0.00550.0027 740.539139.4453
Module start 'content' 0.00820.9172 779.9844568.1797
Module end 'content' 0.92540.0015 1,348.164116.1641
Script end 0.9269  1,364.3281 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00330.3585160.0002
Check MTime0.00140.1469160.0001
Mysql Total
Database connection0.00080.087410.0008
Mysqli_queries0.860392.8054630.0137
Looping result0.00080.0821610.0000
Template Total0.894896.520.4474
Template load0.00210.227020.0011
Template processing0.892796.304820.4463
Template load and register function0.00010.010710.0001
states
state_id_array0.00100.111210.0010
state_identifier_array0.00070.073620.0003
Override
Cache load0.00180.1945360.0001
Sytem overhead
Fetch class attribute can translate value0.00090.099920.0005
Fetch class attribute name0.00150.156870.0002
XML
Image XML parsing0.00100.104420.0005
class_abstraction
Instantiating content class attribute0.00000.0028100.0000
General
dbfile0.00090.0963220.0000
String conversion0.00000.001040.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
5content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
5content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
12content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
4content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
4content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 32
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs