Forums / Setup & design / Changing the left menu behaviour

Changing the left menu behaviour

Author Message

Lydie Soler

Tuesday 02 August 2005 8:28:29 am

Hi,

I have added the left menu to my site. Works well!
It displays all the folders I have.
I would like to change it in order to have on this left menu only the subfolders corresponding to the folder where I am

What do I have to change.....
THansk a lot

Luc Chase

Tuesday 02 August 2005 12:17:35 pm

Assuming you also have the top-menu...
Incrementing the offset value by 1 should do it...
http://ez.no/doc/ez_publish/technical_manual/3_6/reference/modules/content/fetch_functions/tree

The Web Application Service Provider

Lydie Soler

Wednesday 03 August 2005 4:52:34 am

yes your right. But it looses the first top folder...
let me be more precise:
- top folder
- sub folder 1
- sub sub folder 1
- sub folder 2
...

with your solution I don't have top folder...
How can I keep it ?

Lydie Soler

Wednesday 10 August 2005 5:42:54 am

Here is the solution....

Your create a section for each top folder then you use this code replacing part of the old one:


 {section var=menu loop=$:docs last-value}

              {let monnoeud=fetch( 'content', 'node', hash( 'node_id', $menu.id ) )}
{if eq($monnoeud.object.section_id,$module_result.section_id)}


            {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 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}
{/if}
{/let}
        {/section}

What is important is this

 {let monnoeud=fetch( 'content', 'node', hash( 'node_id', $menu.id ) )} 

to get the full information of the node and then

{if eq($monnoeud.object.section_id,$module_result.section_id)} 

to exclude the object that doesn't belong to the same section as the module_result

eZ debug

Timing: Jan 19 2025 09:57:46
Script start
Timing: Jan 19 2025 09:57:46
Module start 'content'
Timing: Jan 19 2025 09:57:46
Module end 'content'
Timing: Jan 19 2025 09:57:46
Script end

Main resources:

Total runtime0.2408 sec
Peak memory usage2,048.0000 KB
Database Queries141

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0071 588.9766180.8281
Module start 'content' 0.00710.0067 769.804793.8984
Module end 'content' 0.01380.2269 863.7031522.3281
Script end 0.2407  1,386.0313 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00421.7262200.0002
Check MTime0.00170.7001200.0001
Mysql Total
Database connection0.00080.347610.0008
Mysqli_queries0.188578.27931410.0013
Looping result0.00160.65861390.0000
Template Total0.226594.110.2265
Template load0.00090.367210.0009
Template processing0.225693.713010.2256
Override
Cache load0.00070.274510.0007
Sytem overhead
Fetch class attribute can translate value0.00090.388710.0009
XML
Image XML parsing0.00030.132510.0003
General
dbfile0.00572.3568200.0003
String conversion0.00000.003330.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
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs