Forums / General / display the name of the main item clicked in the Left menu

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

eZ debug

Timing: Jan 18 2025 19:24:03
Script start
Timing: Jan 18 2025 19:24:03
Module start 'content'
Timing: Jan 18 2025 19:24:04
Module end 'content'
Timing: Jan 18 2025 19:24:04
Script end

Main resources:

Total runtime0.7005 sec
Peak memory usage4,096.0000 KB
Database Queries191

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0060 589.5781180.8047
Module start 'content' 0.00600.5264 770.3828475.9766
Module end 'content' 0.53240.1680 1,246.3594333.4453
Script end 0.7004  1,579.8047 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00420.5969210.0002
Check MTime0.00160.2289210.0001
Mysql Total
Database connection0.00070.106910.0007
Mysqli_queries0.620788.60911910.0032
Looping result0.00220.31361890.0000
Template Total0.671695.920.3358
Template load0.00220.314420.0011
Template processing0.669495.557320.3347
Template load and register function0.00020.029410.0002
states
state_id_array0.00100.146210.0010
state_identifier_array0.00070.094220.0003
Override
Cache load0.00190.2764420.0000
Sytem overhead
Fetch class attribute can translate value0.00280.398730.0009
Fetch class attribute name0.00220.311720.0011
XML
Image XML parsing0.00050.076830.0002
class_abstraction
Instantiating content class attribute0.00000.001020.0000
General
dbfile0.00420.5987210.0002
String conversion0.00000.000730.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

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
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 16
 Number of unique templates used: 6

Time used to render debug report: 0.0002 secs