Forums / Setup & design / Current navigation rollover - retaining status for child nodes.

Current navigation rollover - retaining status for child nodes.

Author Message

steve walker

Wednesday 20 October 2004 10:49:47 am

HI there!

I have a slightly changed sub_left.tpl navigation that has a bit of extra code in so the css can change the button colour when its a selected page. Looks like:

{section show=and( is_set( $module_result.path[1] ), is_set( $module_result.node_id ) )}
{let root_node=fetch( content, node, hash( node_id, 2 ) )
     submenu=fetch( content, list, hash( parent_node_id, $module_result.path[1].node_id,
                                         class_filter_type, include,
                                         class_filter_array, ezini( 'MenuContentSettings', 'LeftIdentifierList', 'menu.ini' ),
                                         sort_by, $root_node.sort_array ) )}
    <ul>
    {section var=menu loop=$submenu}
        <li {section show=eq($menu.node_id,$module_result.node_id)} class="menu-level-0-selected" {section-else} class="menu-level-0" {/section}><a href={$menu.url_alias|ezurl}>{$menu.name|shorten( 32 )}</a></li>
    {/section}

{/let}
{/section}

My problem is with:

<li {section show=eq($menu.node_id,$module_result.node_id)} class="menu-level-0-selected" {section-else} class="menu-level-0" {/section}><a href={$menu.url_alias|ezurl}>

It works fine if you go to the node thats represented on this sub navigation - but if you click on a child node the 'class="menu-level-0-selected"' isnt used, and the button reverts to unselected state.

Does anyone know how to tweak this code so that it keeps the state for all its child nodes? Is it using something like $module_result.path[1]?

Many thanks, Steve.

http://www.oneworldmarket.co.uk

Paul Forsyth

Wednesday 20 October 2004 12:23:02 pm

Steve,

I think this is what you need:

http://ez.no/ez_publish/documentation/reference/template_operators/miscellaneous/treemenu

paul

steve walker

Thursday 21 October 2004 10:50:27 am

Paul,

Thanks for the reply - will take a look and give it a go.

Regards, Steve.

http://www.oneworldmarket.co.uk