sort unique children

Author Message

Milad P

Thursday 31 May 2007 11:07:52 am

I want to list my latest forum topics on the first page. Currently I use the fetch code below, but I get same topic back serveral times. How can i sort uniquelly in my node so that only one forum_reply from each forum_topic will be listed?

    {def $children = fetch('content', 'tree', hash('parent_node_id', 321, main_node_only, true(), class_filter_type, 'include', class_filter_array, array('forum_topic'), sort_by, array('modified', false()), limit,10 ))}

Bruce Morrison

Thursday 31 May 2007 4:20:36 pm

Hiya

Try adding

'main_node_only', true()

Cheers
Bruce

My Blog: http://www.stuffandcontent.com/
Follow me on twitter: http://twitter.com/brucemorrison
Consolidated eZ Publish Feed : http://friendfeed.com/rooms/ez-publish

Milad P

Friday 01 June 2007 12:53:19 am

I have tried that, but the problem is that every forum_reply has already a unique main_node_id.

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 31 2025 01:35:25
Script start
Timing: Jan 31 2025 01:35:25
Module start 'layout'
Timing: Jan 31 2025 01:35:25
Module start 'content'
Timing: Jan 31 2025 01:35:25
Module end 'content'
Timing: Jan 31 2025 01:35:25
Script end

Main resources:

Total runtime0.0251 sec
Peak memory usage6,144.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0055 588.0078151.1953
Module start 'layout' 0.00550.0049 739.2031220.6719
Module start 'content' 0.01040.0131 959.8750997.8672
Module end 'content' 0.02350.0016 1,957.742229.9922
Script end 0.0251  1,987.7344 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002710.6899140.0002
Check MTime0.00114.2824140.0001
Mysql Total
Database connection0.00072.814110.0007
Mysqli_queries0.003012.106030.0010
Looping result0.00000.095910.0000
Template Total0.00124.610.0012
Template load0.00093.622810.0009
Template processing0.00030.999410.0003
Override
Cache load0.00062.253210.0006
General
dbfile0.00020.968180.0000
String conversion0.00000.044640.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.0001 secs