Sort by Expression

Author Message

m.zaki ahmed

Monday 14 May 2007 6:15:04 am

hi
i want to fetch the 4 nearest events to current date even its event_date was in past or in future

my idea is to fetch from event class limit by 4 and sort by the different between its event_date and current date
some thing like that

{ fetch( 'content', 'list', hash( 'parent_node_id', 42, 'limit', 4, 'sort_by', array( date_sub('event/event_date',current date ), false() ) ) )}

is it possible?


m.zaki ahmed

Sunday 20 May 2007 1:41:03 am

hi
any help

André R.

Sunday 20 May 2007 8:43:29 am

take a look in overrides/templates/full/event_view_program.tpl in the ezwebin extension for getting the next / prev x events

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom

m.zaki ahmed

Tuesday 22 May 2007 4:56:47 am

is this in ezpublish 3.9? , i use 3.68

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 18 2025 18:17:13
Script start
Timing: Jan 18 2025 18:17:13
Module start 'layout'
Timing: Jan 18 2025 18:17:13
Module start 'content'
Timing: Jan 18 2025 18:17:13
Module end 'content'
Timing: Jan 18 2025 18:17:13
Script end

Main resources:

Total runtime0.0175 sec
Peak memory usage4,096.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0063 588.9297152.6094
Module start 'layout' 0.00630.0035 741.539139.4297
Module start 'content' 0.00980.0055 780.968889.3047
Module end 'content' 0.01530.0021 870.273434.3047
Script end 0.0175  904.5781 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002614.9893140.0002
Check MTime0.00126.8685140.0001
Mysql Total
Database connection0.00116.361510.0011
Mysqli_queries0.002916.386230.0010
Looping result0.00000.171710.0000
Template Total0.00179.810.0017
Template load0.00084.493110.0008
Template processing0.00095.316210.0009
Override
Cache load0.00053.104410.0005
General
dbfile0.00126.762280.0001
String conversion0.00000.064140.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0002 secs