|
Marco Zinn
|
Saturday 03 January 2004 4:14:10 am
Comment39495
Hi,
well, i didn't completely understand the code:
{let comment_parent_array=array(0) comment_list=fetch(content,list,hash(parent_node_id,2,limit,6,depth,5,sort_by,array(published,false()),class_filter_type,include,class_filter_array,array('comment')))}
{section name=Comment loop=$comment_list}
{section show=not($comment_parent_array|contains($Comment:item.id)) comment_parent_array=$comment_parent_array|insert($Comment:item.id)}
[..]
What is $comment_parent_array used for? You want to store the IDs of the articles in the array and check, if and ID already exists? Nice idea :)
But you say, it does not work.
First, I thought "use max=1 in the loop", so you will get only one comment. But you seem to fetch all commments with one single fetch.
Then, maybe you should try something like this (pseudo-code ;) )
Fetch all articles
section loop=article
fetch all comments, where the current article is parent node, sorted by date
section loop=comments, max=1 show=comments
print comment with parent node name
/section /section This might work, but the drawback is, that you need LOTS of DB fetches.
Marco
http://www.hyperroad-design.com
|