Forums / Developer / Sort by Expression

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