Creating an EZdate within an template, for customizing EZ demo blog calendar

Author Message

Tore Skobba

Thursday 11 March 2004 1:35:45 am

Hi

I want to use the "EZ calendar" (monthview.tpl). As a source I am using the Blog example. However, instead of using it as an archive I would like to use it for forthcoming events. Therefore I have an "calendar folder" having several calendar_event (s) each having an Date field attribute. However, I am not managing to use the actual date in my fetch on attribute date(i.e. fetch all articles for an particular day). I belive this is because I do not know what I should compare the EZdata to? But since it is an EZdate I thought about fetching the current date, making an ezdate of that and then compare with it.

More specific below here:
I am customizing the "archive_navigatorbar.tpl" file in the blog example. Which has an fetch selecting all "log" grouped on which day they are "published". However I would like to group by my own date field instead of "published". But datafield is an EZ data and I cannot manage to check for dataes in my fetch sentence.

Orginal Code:
attribute_filter, array( and, array( 'published', '>=',maketime( 0, 0, 0,$today_info.month, 1, $today_info.year ) ),
array( 'published', '<=',maketime( 23, 59, 59, $today_info.month | inc, 0,$today_info.year ) ) ),

My wanted change:
attribute_filter, array( and, array( 'date', '>=',maketime( 0, 0, 0,$today_info.month, 1, $today_info.year ) ),
array( 'date', '<=',maketime( 23, 59, 59, $today_info.month | inc, 0,$today_info.year ) ) ),

But this does not work and gives me an SQL error.

UPDATE: I have solved the syntax problem now.. However, my idea of altering the temaplte was not correct. The SQL error was due to using the attribute name instead of the id. Once I changed date to its id it worked.
Cheers
Tore

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 07:14:59
Script start
Timing: Jan 19 2025 07:14:59
Module start 'layout'
Timing: Jan 19 2025 07:14:59
Module start 'content'
Timing: Jan 19 2025 07:14:59
Module end 'content'
Timing: Jan 19 2025 07:14:59
Script end

Main resources:

Total runtime0.5720 sec
Peak memory usage4,096.0000 KB
Database Queries46

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0053 589.6484152.6875
Module start 'layout' 0.00530.0031 742.335939.5234
Module start 'content' 0.00840.5621 781.8594412.1641
Module end 'content' 0.57050.0015 1,194.02348.0625
Script end 0.5720  1,202.0859 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00320.5586160.0002
Check MTime0.00120.2183160.0001
Mysql Total
Database connection0.00090.151910.0009
Mysqli_queries0.535393.5731460.0116
Looping result0.00040.0675440.0000
Template Total0.546295.520.2731
Template load0.00190.337720.0010
Template processing0.544295.136720.2721
Template load and register function0.00010.023810.0001
states
state_id_array0.00040.075910.0004
state_identifier_array0.00070.121720.0003
Override
Cache load0.00160.2717180.0001
Sytem overhead
Fetch class attribute can translate value0.00090.163110.0009
Fetch class attribute name0.00050.083710.0005
XML
Image XML parsing0.00010.026210.0001
class_abstraction
Instantiating content class attribute0.00000.000910.0000
General
dbfile0.00070.1291100.0001
String conversion0.00000.001740.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
1content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
5content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.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: 12
 Number of unique templates used: 5

Time used to render debug report: 0.0001 secs