How to do this ? fetch idea needed .. help plz !

Author Message

Selmah Maxim

Monday 14 February 2005 10:24:09 am

Hi all ...

I have multi folders, sub folders, and I have company_info class listed in the folders, now I don`t wanna show a folder if its doesn`t include any of company_info .... this done easy, but the problem is if the main find 1 of my class under main folder will list also the sub folders so how to do this !??

hhhmmm ... something like this ..

<b>Main Folder1</b>{folder class)
xman{folder class,empty)
my company [company_info class]
rambo{folder class,empty)
ezpublish{folder class,empty)

Now, i wanna list the main folder with the subs which have company-info just ..
I worte this, but didn`t work !

{section loop=fetch( 'content', 'tree', hash( 'parent_node_id', 2, 
												class_filter_type, "include", 
												class_filter_array, array($Business_Folder),
												depth, 2,
												depth_operator, eq
												,sort_by,array('name',true() ) 
												 ) ) }

	{*<!-- Count the info class items in each b.folder -->*} 		
	{let Child_Count=fetch( 'content',	'tree_count',hash( 
										'parent_node_id', $:item.node_id,
										depth,0,
										class_filter_type, "include",
										class_filter_array, array($Company_Info),
										attribute_filter, array('and', array('company_info/online_status','!=',0))
										)) }
								
		{section show=$:Child_Count|gt(0)}
		<td width=20% valign="top">
		<a  href={$MainCats:item.url_alias|ezurl} title="{$Main_Category:item.name}" ID="BigCategoryLink">
		{$:item.name}</a>[{$:Child_Count}]<br>
		{*<!--List the sub cats-->*} 
			{section loop=fetch( 'content', 'tree', hash( 'parent_node_id', $:item.node_id, 
												depth, 1,
												class_filter_type, "include", 
												class_filter_array, array($Business_Folder),
												 )) }
					{*section show=$:item.children_count|gt(0)*}
								<a ID="SmallCategoryLink" href={$:item.url_alias|ezurl} title="{$:item.name}">{$:item.name}</a><br>
					{/section}			
						{*/section*}
			{/section}					
												 
			
		
	{/let}
	</td>
{delimiter modulo=3}</tr><tr>{/delimiter} 

{/section}

Thx in advance !

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