Fetch list/tree: The group_by parameter

Author Message

Roy Bøhmer

Sunday 07 August 2005 11:10:13 am

Could someone give an example on how to use the group_by parameter when doing a content-list or content-tree fetch?
I can't find anything in the docs on that, and some trial and error as resulted in only trial and errors :-)

Thanks!

Roy Bøhmer

Sunday 07 August 2005 11:37:38 am

I found this thread http://ez.no/community/forum/setup_design/group_by_parameter_in_fetch_function, but I still need some more hints.

Can I group by a custom date/time attribute? How?

It seems like it only picks the first node - more like a 'unique' kind of function. I would like it to return an array containing one array for each group.

Enlight me, please :)

- roy

Conrad Chu

Tuesday 14 February 2006 4:35:19 pm

I don't know the usage myself, but I did find an example of it here

Inside /design/standard/templates/toolbar/full/calendar.tpl:

{set month_list=fetch( content, calendar, hash( parent_node_id,$log_node.node_id,
class_filter_type, include,
class_filter_array, $class_identifier_list,
attribute_filter, array( and, array( 'published', '>=',
$time_start ),
array( 'published', '<=',
$time_end ) ),
group_by, array( "published", "day" ) ) )

Samuel Sauder

Monday 16 October 2006 7:43:28 am

I was trying to figure this out too. Note that group_by is deprecated:
http://ez.no/doc/ez_publish/technical_manual/3_8/reference/modules/content/fetch_functions/list
<i>The optional "group_by" parameter (grouping on a date/time basis) is deprecated since this functionality is not supported by Oracle and PostgreSQL.</i>

This doesn't make any sense to me... Is EZ saying that Oracle and PostgreSQL don't support GROUP BY syntax in SQL?

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