display the name of the main item clicked in the Left menu

Author Message

Amer Azzaz

Tuesday 03 January 2006 1:38:21 am

i m trying to display dynamically the folders of the main menu sections. (when i click on an item in the main menu, i want to display in the left menu the name of the main menu and all the folders names in this menu item. My problem is that the name of the main node is displayed only the first time in the left menu, then it disappears the second time i click on it in the main menu. Any idea? i m using the following code

<div id="leftmenu">
<div id="leftmenu-design">

<h3 class="hide">{"Left sub menu"|i18n("design/hashultra")}</h3>

{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 ) )}
<table border="0" cellpadding="0" cellspacing="0">

<tr>
<td width="10" class="menu_second_bullet">
<img src={"left_arrow.jpg"|ezimage} width="10" height="11"></td>
<td width="146" class="menu_second">{$node.name}</td>
</tr>

{section var=menu loop=$submenu}

<tr>
<td class="menu_second_bullet"></td>
<td class="menu_third"><a href={$menu.url_alias|ezurl}>{$menu.name|shorten( 25 )}</a></td>
</tr>


{/section}
</table>


<div class="breakall"></div>

{/let}
{/section}

</div>
</div>

Philipp Simon

Saturday 17 June 2006 9:10:56 am

I justed searched myself in the forum for a solution. Finally I found nothing and came up with this little hack. I am new to ezPublish, so perhaps there is a much better way for doing this.

{if eq( $module_result.node_id, 2 ) }
     {let $tmp_root_node=fetch( content, node, hash( node_id, 2 ) )}
          <div class="menu-header">{$tmp_root_node.name}</div>
     {/let}
{else}
     <div class="menu-header">{$module_result.path[1].text}</div>
{/if}

Phil

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 18 2025 22:16:49
Script start
Timing: Jan 18 2025 22:16:49
Module start 'layout'
Timing: Jan 18 2025 22:16:49
Module start 'content'
Timing: Jan 18 2025 22:16:50
Module end 'content'
Timing: Jan 18 2025 22:16:50
Script end

Main resources:

Total runtime0.5853 sec
Peak memory usage4,096.0000 KB
Database Queries54

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0051 588.1641152.6563
Module start 'layout' 0.00510.0030 740.820339.5078
Module start 'content' 0.00810.5761 780.3281470.8672
Module end 'content' 0.58420.0011 1,251.19538.0938
Script end 0.5853  1,259.2891 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00340.5818160.0002
Check MTime0.00130.2279160.0001
Mysql Total
Database connection0.00090.150310.0009
Mysqli_queries0.539592.1757540.0100
Looping result0.00050.0886520.0000
Template Total0.554594.720.2772
Template load0.00220.384220.0011
Template processing0.552294.342420.2761
Template load and register function0.00020.032710.0002
states
state_id_array0.00140.244310.0014
state_identifier_array0.00080.141520.0004
Override
Cache load0.00190.3260420.0000
Sytem overhead
Fetch class attribute can translate value0.00080.143020.0004
Fetch class attribute name0.00110.179720.0005
XML
Image XML parsing0.00030.048620.0001
class_abstraction
Instantiating content class attribute0.00000.000920.0000
General
dbfile0.00070.1186100.0001
String conversion0.00000.001540.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
2content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
7content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
4content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 16
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs