| Softriva .com
                                                                                                                             
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     | Monday 19 February 2007 6:39:44 am 
                                                                
                                                                 Hello, I have the following content strcuture 
News (N65)--2005
 ----News1
 ----News22
 --2006
 ----News3
 ----News11
 ----News14
 ----News26
 --2007
 ----News12
 ----News10
 I only can know the news folder node id which 65 and of course the year. How can I fetch the children? I tried this but not sure if it's ok {def latest_news=fetch( 'content', list, hash( 'parent_node_id', 65,
				'sort_by', array( 'published', false() ),
				 'limit',3,
                                 'attribute_filter', array( array( 'folder/name','=',$CurrentYear)) | 
                                                
                                                                                                                                                        
                                                        | Softriva .com
                                                                                                                             | Monday 19 February 2007 9:46:09 am 
                                                                 oooooops, sorry, I want to fetch the news1, news22, news14, etc. | 
                                                                                                    
                                                        | Damarev .
                                                                                                                             | Monday 19 February 2007 6:45:29 pm 
                                                                 This could be a simple solution: 
{def $current_folder=fetch( 'content', list, hash( 'parent_node_id', 65,'limit',1,
 'attribute_filter', array( array( 'folder/name','=',$CurrentYear))
 }
 {def $last_folder_id=$current_folder[0].node_id} 
{def $latest_news=fetch( 'content', list, hash( 'parent_node_id', $last_folder_id,'sort_by', array( 'published', false() ),
 }
 I know this is not the perfect approach, but it works. |