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.

eZ debug

Timing: Jan 18 2025 16:13:47
Script start
Timing: Jan 18 2025 16:13:47
Module start 'layout'
Timing: Jan 18 2025 16:13:47
Module start 'content'
Timing: Jan 18 2025 16:13:47
Module end 'content'
Timing: Jan 18 2025 16:13:47
Script end

Main resources:

Total runtime0.0137 sec
Peak memory usage2,048.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0044 589.1484152.6406
Module start 'layout' 0.00440.0024 741.789139.4766
Module start 'content' 0.00680.0049 781.265689.2266
Module end 'content' 0.01170.0019 870.492234.3047
Script end 0.0136  904.7969 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002417.4038140.0002
Check MTime0.00107.4945140.0001
Mysql Total
Database connection0.00053.508010.0005
Mysqli_queries0.001813.241030.0006
Looping result0.00000.080310.0000
Template Total0.001611.810.0016
Template load0.00096.811710.0009
Template processing0.00074.973010.0007
Override
Cache load0.00064.459710.0006
General
dbfile0.00021.733980.0000
String conversion0.00000.059440.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