eZ Community » Forums » Setup & design » How do I add an 3rd level to the left...
expandshrink

How do I add an 3rd level to the left menu?

How do I add an 3rd level to the left menu?

Wednesday 08 September 2010 11:50:25 am - 2 replies

Hi,

4.3.0 install / ezflow with the left hand menu enabled.

I tried to increase the depth in the code flat_left.tpl but that didn't work.

can someone please point me in the right direction to get an extra level?

thanks in advance happy.gif Emoticon

Wednesday 08 September 2010 10:17:18 pm

may be mistakes, but works for me

<code>

{def $left_menu_depth = $pagedata.current_menu|eq('LeftOnly')|choose( 1, 0 )
$left_menu_root_url = cond( $pagedata.path_array[ $left_menu_depth ].url_alias, $pagedata.path_array[ $left_menu_depth ].url_alias, $requested_uri_string )}
<h4><a href={if eq( $ui_context, 'browse' )}{concat("content/browse/", $pagedata.path_array[ $left_menu_depth ].node_id)|ezurl}{else}{$left_menu_root_url|ezurl}{/if}>{$pagedata.path_array[ $left_menu_depth ].text}</a></h4>
{if ne( $pagedata.class_identifier, 'documentation_page' )}
{def $root_node=fetch( 'content', 'node', hash( 'node_id', $pagedata.path_array[$left_menu_depth].node_id ) )
$left_menu_items = fetch( 'content', 'list', hash( 'parent_node_id', $root_node.node_id,
'sort_by', $root_node.sort_array,
'data_map_load', false(),
'class_filter_type', 'include',
'class_filter_type', 'include',
'class_filter_array', ezini( 'MenuContentSettings', 'LeftIdentifierList', 'menu.ini' ) ) )
$left_menu_items_count = $left_menu_items|count()
$li_class = array()
$a_class = array()
$current_node_in_path_2 = first_set( $pagedata.path_array[$left_menu_depth|inc].node_id, 0 )
$current_node_in_path_3 = first_set( $pagedata.path_array[$left_menu_depth|sum(2)].node_id, 0 )
$current_node_in_path_4 = first_set( $pagedata.path_array[$left_menu_depth|sum(3)].node_id, 0 ) {* Def der zusätzlichen Ebene *}
{if $left_menu_items_count}
<ul class="menu-list">
{foreach $left_menu_items as $key => $item}
{set $a_class = cond($current_node_in_path_2|eq($item.node_id), array("selected"blunk.gif Emoticon, array())
$li_class = cond( $key|eq(0), array("firstli"blunk.gif Emoticon, array() )}
{if $left_menu_items_count|eq( $key|inc )}
{set $li_class = $li_class|append("lastli"blunk.gif Emoticon}
{/if}
{if $item.node_id|eq( $current_node_id )}
{set $a_class = $a_class|append("current"blunk.gif Emoticon}
{/if}
{if eq( $item.class_identifier, 'link')}
<li{if $li_class} class="{$li_class|implode(" "blunk.gif Emoticon}"{/if}><div class="second_level_menu"><a {if eq( $ui_context, 'browse' )}href={concat("content/browse/", $item.node_id)|ezurl}{else}href={$item.data_map.location.content|ezurl} target="_blank"{/if}{if $a_class} class="{$a_class|implode(" "blunk.gif Emoticon}"{/if} title="{$item.data_map.location.data_text|wash}">{$item.name|wash()}</a></div>
{else}
<li{if $li_class} class="{$li_class|implode(" "blunk.gif Emoticon}"{/if}><div class="second_level_menu"><a href={if eq( $ui_context, 'browse' )}{concat("content/browse/", $item.node_id)|ezurl}{else}{$item.url_alias|ezurl}{/if}{if $a_class} class="{$a_class|implode(" "blunk.gif Emoticon}"{/if}>{$item.name|wash()}</a></div>
{/if}
{if eq( $current_node_in_path_2, $item.node_id )} {* Anzeige der Subitems *}
{def $sub_menu_items = fetch( 'content', 'list', hash( 'parent_node_id', $item.node_id,
'sort_by', $item.sort_array,
'data_map_load', false(),
'class_filter_type', 'include',
'class_filter_array', ezini( 'MenuContentSettings', 'LeftIdentifierList', 'menu.ini'
) ) )
$sub_menu_items_count = $sub_menu_items|count}
{if $sub_menu_items_count}
<ul class="submenu-list">
{foreach $sub_menu_items as $subkey => $subitem} {* 2. foreach-Schleife *}
{set $a_class = cond($current_node_in_path_3|eq($subitem.node_id), array("selected"blunk.gif Emoticon, array())
$li_class = cond( $subkey|eq(0), array("firstli"blunk.gif Emoticon, array() )}
{if $sub_menu_items_count|eq( $subkey|inc )}
{set $li_class = $li_class|append("lastli"blunk.gif Emoticon}
{/if}
{if $subitem.node_id|eq( $current_node_id )}
{set $a_class = $a_class|append("current"blunk.gif Emoticon}
{/if}
{if eq( $subitem.class_identifier, 'link')}
<li{if $li_class} class="{$li_class|implode(" "blunk.gif Emoticon}"{/if}><div class="third_level_menu"><a {if eq( $ui_context, 'browse' )}href={concat("content/browse/", $subitem.node_id)|ezurl}{else}href={$subitem.data_map.location.content|ezurl} target="_blank"{/if}{if $a_class} class="{$a_class|implode(" "blunk.gif Emoticon}"{/if} title="{$subitem.data_map.location.data_text|wash}">{$subitem.name|wash()}</a></div></li>
{else}
<li{if $li_class} class="{$li_class|implode(" "blunk.gif Emoticon}"{/if}><div class="third_level_menu"><a href={if eq( $ui_context, 'browse' )}{concat("content/browse/", $subitem.node_id)|ezurl}{else}{$subitem.url_alias|ezurl}{/if}{if $a_class} class="{$a_class|implode(" "blunk.gif Emoticon}"{/if}>{$subitem.name|wash()}</a></div></li>
{/if}
{* aber hier von mir neu: *}
{if eq( $current_node_in_path_3, $subitem.node_id )}
{def $sub3_menu_items = fetch( 'content', 'list', hash( 'parent_node_id', $subitem.node_id,
'sort_by', $subitem.sort_array,
'data_map_load', false(),
'class_filter_type', 'include',
'class_filter_array', ezini( 'MenuContentSettings', 'LeftIdentifierList', 'menu.ini' ) ) )
$sub3_menu_items_count = $sub3_menu_items|count}
{if $sub3_menu_items_count}
<ul class="sub3menu-list">
{foreach $sub3_menu_items as $subkey => $subitem} {* 3. foreach-Schleife der zusätzlichen Ebene *}
{set $a_class = cond($current_node_in_path_4|eq($subitem.node_id), array("selected"blunk.gif Emoticon, array())
$li_class = cond( $subkey|eq(0), array("firstli"blunk.gif Emoticon, array() )}
{if $sub3_menu_items_count|eq( $subkey|inc )}
{set $li_class = $li_class|append("lastli"blunk.gif Emoticon}
{/if}
{if $subitem.node_id|eq( $current_node_id )}
{set $a_class = $a_class|append("current"blunk.gif Emoticon}
{/if}
{if eq( $subitem.class_identifier, 'link')}
<li{if $li_class} class="{$li_class|implode(" "blunk.gif Emoticon}"{/if}><div class="four_level_menu"><a {if eq( $ui_context, 'browse' )}href={concat("content/browse/", $subitem.node_id)|ezurl}{else}href={$subitem.data_map.location.content|ezurl} target="_blank"{/if}{if $a_class} class="{$a_class|implode(" "blunk.gif Emoticon}"{/if} title="{$subitem.data_map.location.data_text|wash}">{$subitem.name|wash()}</a></div></li>
{else}
<li{if $li_class} class="{$li_class|implode(" "blunk.gif Emoticon}"{/if}><div class="four_level_menu"><a href={if eq( $ui_context, 'browse' )}{concat("content/browse/", $subitem.node_id)|ezurl}{else}{$subitem.url_alias|ezurl}{/if}{if $a_class} class="{$a_class|implode(" "blunk.gif Emoticon}"{/if}>{$subitem.name|wash()}</a></div></li>
{/if}
{/foreach} {* Ende 3. foreach-Schleife der zusätzlichen Ebene *}
</ul> {* schließt das ul from additional level *}
{/if} {* end-if from additional level *}
{undef $sub_menu_items $sub_menu_items_count $sub3_menu_items }
{/if} {* end-if from 2. level *}
{/foreach} {* Ende 2. foreach-Schleife *}
</ul> {* schließt das ul from 2. level *}
{/if}
{/if}
</li>
{/foreach} {* Ende oberste foreach-Schleife *}
</ul>{* schließt das ul from 1. level *}
{/if}
{undef $root_node $left_menu_items $left_menu_items_count $a_class $li_class $current_node_in_path_2 $current_node_in_path_3}
{else}
<div class="contentstructure">
{def $current_node = fetch( content, node, hash( node_id, $current_node_id ) )
$chapter_container = fetch( content, node, hash( node_id, $current_node.path_array[$left_menu_depth|inc] ) )
$class_filter = ezini( 'TreeMenu', 'ShowClasses', 'contentstructuremenu.ini' )
$depth = is_set( $current_node.path_array[$left_menu_depth|sum(2)] )|choose( $left_menu_depth|sum(3), 0 )
$node_to_unfold = is_set( $current_node.path_array[$left_menu_depth|sum(2)] )|choose(0 , current_node.path_array[$left_menu_depth|sum(2)] )
$contentStructureTree = content_structure_tree( $chapter_container.node_id, $class_filter, $depth, 0, 'false', false(), $node_to_unfold )}
{include uri='design:simplified_treemenu/show_simplified_menu.tpl' contentStructureTree=$contentStructureTree is_root_node=true() skip_self_node=true() current_node_id=$current_node_id unfold_node=$node_to_unfold chapter_level=0}
{undef $current_node $chapter_container $class_filter $depth $node_to_unfold $contentStructureTree}
</div>
{/if}

</code>

Friday 10 September 2010 2:57:57 pm

Thank you Martin, that works perfectly happy.gif Emoticon

expandshrink

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu

Proudly Developed with from