Jon Staines
|
Friday 08 December 2006 8:22:04 am
If it is just stopping the menu from disappearing then I had the same problem. If there are further page breaks then can you explain how it broke? For the missing menu on a search page I've used 2 different solutions depending on the site. If your menu is always the same, ie only one level or you use flyout menus so always have to load the whole thing then I used something like (where xxxxx is the root of the tree):
{let root_node=fetch( content, node, hash( node_id, 2 ) )
menuitems=fetch( content, list, hash( parent_node_id, xxxxx,
class_filter_type, include,
class_filter_array, ezini( 'MenuContentSettings', 'LeftIdentifierList', 'menu.ini' ),
sort_by, $root_node.sort_array ) )}
{* MOZILLA MENU *}
<div id="leftmenu-design">
<ul class="flyout1" id="nav-flyout">
{section var=menu loop=$menuitems}
The li entry goes here, or have a further lookup based on the node id of this entry if you want more levels for flyouts.
{/section}
</ul>
</div>
If your design drops into sublevels of the menu so you need it to know the what node you are in for pages other than the search, then try:
{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}
{if eq($:docs|count(),0)}
{let root_node=fetch( content, node, hash( node_id, 2 ) )
menuitems=fetch( content, list, hash( parent_node_id, 2,
class_filter_type, include,
class_filter_array, ezini( 'MenuContentSettings', 'LeftIdentifierList', 'menu.ini' ),
sort_by, $root_node.sort_array ) )}
{section var=menu loop=$menuitems}
<li class="menu-level-0"><a href={$menu.url_alias|ezurl}>{$menu.name}</a></li>
{/section}
{else}
{section var=menu loop=$:docs last-value}
Normal menu template code in here
{/section}
{/if}
{/let}
In this, it checks if there would be results to form the tree and if it fails, a search page, then it just loads the default tree starting from node 2. Hope this points you in the right direction.
|