Forums / General / Need help with filtering out sections when useing treemenu

"Please Note:
  • At the specific request of Ibexa we are changing this projects name to "Exponential" or "Exponential (CMS)" effective as of August, 11th 2025.
  • This project is not associated with the original eZ Publish software or its original developer, eZ Systems or Ibexa".

Need help with filtering out sections when useing treemenu

Author Message

Kjell Arne Espedal

Friday 25 February 2005 4:31:31 am

The problem is that I got a couple of folders in root that should not be a part off the menu.

Example:
folder1 - section1
folder2 - section2
folder3 - section3
folder4 - section3
folder5 - section3

What I want is to list the 3 folders that is in section 3 but not the others

{let subMenu=treemenu( $module_result.path, 
                        $module_result.node_id,
			array('folder','article'), 0, 2 )}

{section var=menu loop=$subMenu}
      <div class="colMenu{$menu.item.level}">
          <a href={$menu.item.url_alias|ezurl}>{$menu.item.text}</a>
      </div>
{/section}
{/let}

Suggestions to make this code work as mentioned above is highly appreciated.
I'm using Exponential version 3.5

Łukasz Serwatka

Monday 28 February 2005 10:47:08 pm

{let subMenu=treemenu( $module_result.path, 
                        $module_result.node_id,
			array('folder','article'), 0, 2 )
	sectionIds=array( 5, 4, 123 ) } {*section ids to display*}

{section var=menu loop=$subMenu}
	{let nodeData=fetch(content, node, hash( node_id, $menu.id ) )}
	{section show=$sectionIds|contains( $nodeData.object.section_id )}
		<div class="colMenu{$menu.item.level}">
          		<a href={$menu.item.url_alias|ezurl}>{$menu.item.text}</a>
     		</div>	
	{/section}
	{/let}
{/section}
{/let}

Personal website -> http://serwatka.net
Blog (about eZ Publish) -> http://serwatka.net/blog