Solution: The Missing eZ publish Left Menu with Index
About
from : zurgutt
description: Left menu with indexpage in it.
Example
Here is a hack code for left menu override, which will add indexpage as first item in menu.
Its very strange its not there to begin with - almost all sites need it.
<div id="leftmenu">
<div id="leftmenu-design">
<h3 class="hide">{"Left menu"|i18n("design/base")}</h3>
{let docs=treemenu( $module_result.path,
is_set( $module_result.node_id )|choose( 2, $module_result.node_id ),
ezini( 'MenuContentSettings', 'LeftIdentifierList', 'menu.ini' ),
0, 5 )
depth=1
last_level=0
root_node=fetch( content, node, hash( node_id, 2 ) )
root_node_array=array( hash('id', $root_node.node_id,
'level', 0,
'url_alias', $root_node.url_alias,
'url', $root_node.url,
'text', $root_node.name,
'is_selected', eq($module_result.node_id, $root_node.node_id)
) )
}
<ul>
{section var=menu loop=merge($root_node_array, $:docs) last-value}
{set last_level=$menu.last|is_array|choose( $menu.level, $menu.last.level )}
{section show=and( $last_level|eq( $menu.level ), $menu.number|gt( 1 ) )}
</li>
{section-else}
{section show=and( $last_level|gt( $menu.level ), $menu.number|gt( 1 ) )}
</li>
{"</ul>
</li>"|repeat(sub( $last_level, $menu.level ))}
{/section}
{/section}
{section show=and( $last_level|lt( $menu.level ), $menu.number|gt( 1 ) )}
{'<ul><li>'|repeat(sub($menu.level,$last_level,1))}
<ul>
<li class="menu-level-{$menu.level}">
{section-else}
<li class="menu-level-{$menu.level}">
{/section}
<a {$menu.is_selected|choose( '', 'class="selected"' )} href={$menu.url_alias|ezurl}>{$menu.text|shorten( 25 )}</a>
{set depth=$menu.level}
{/section}
</li>
{section show=sub( $depth, 0 )|gt( 0 ) loop=sub( $depth, 0 )}
</ul>
</li>
{/section}
</ul>
{/let}
</div>
</div> 