Forums / Setup & design / adding tree functionality to 3.4 subleft menu template

adding tree functionality to 3.4 subleft menu template

Author Message

steve walker

Thursday 17 June 2004 6:57:13 am

Hi there,

I want to create a 'TopLeft' nav system with subnavigation being listed down the left. The sub_left template does this, but doesnt expand to show further naviagtion, unlike the full flat_left template that has full tree menu functionality - and I want my sub_left template to behave as it is, but to exapnd treemenu styley!

I think the easiest solution is to hack the flat_left menu so that it starts at the subnav level, rather than at topnav level. The other alternative is to add treemenu functionality into the subleft template...

Could anyone give a pointer on doing this, my coding brain isnt that great...

Thanks, Steve.

http://www.oneworldmarket.co.uk

Mark Marsiglio

Thursday 17 June 2004 10:47:59 am

I think I have done what you are trying to do, but I am not sure. I have top level objects listed across the top of my site (in tabs). When you click on one of the tabs, the pages within that section appear in a left hand nav list with the section name at the top. If this is what you are trying to do I can post some code...

http://www.thinkcreative.com
Turning Ideas Into Strategic Solutions

steve walker

Thursday 17 June 2004 12:02:30 pm

Mark,

It may be... I have top nav on top, and left hand sub nav working fine - but the left hand subnavigation doesnt expand out to show the third level navigation, and this is the bit I want to add.

If you have code that does this that would be marvellous!

Steve.

http://www.oneworldmarket.co.uk

Mark Marsiglio

Thursday 17 June 2004 12:36:47 pm

Try this...I have the depth set to 4 (four levels deep) but that is adjustable. In fact, that might be the only thing that I changed. This file is called flat_left.tpl and is located in mydesign/override/templates/menu folder.

Good luck...
Mark

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

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

<div id="navparent">
       {section name=parent loop=$module_result.path max=1 offset=1 }
             {section show=$parent:item.url}
                  <a href={$parent:item.url_alias|ezurl}>{$parent:item.text|wash}</a>
               {section-else}
    	      {$parent:item.text|wash}
               {/section}
    
         {/section}
</div>

{let docs=treemenu( $module_result.path,
                    $module_result.node_id,
                    array( 'folder', 'infopage', 'article' ), 1, 5 )
                    depth=4}
        <ul>
        {section var=menu loop=$:docs last-value}
            {section show=and( $menu.last.level|eq( $menu.level ), $menu.number|gt( 1 ) )}
                </li>
            {section-else}
            {section show=and( $menu.last.level|gt( $menu.level ), $menu.number|gt( 1 ) )}
                </li>
                    {"</ul>
                </li>"|repeat(sub( $menu.last.level, $menu.level ))}
            {/section}
            {/section}

            {section show=and( $menu.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}
        {/section}
           </li>

        {section show=sub( $depth, 0 )|gt( 0 ) loop=sub( $depth, 0 )}
            </ul>
        </li>
        {/section}
        </ul>

{/let}

</div>
</div>

http://www.thinkcreative.com
Turning Ideas Into Strategic Solutions

steve walker

Friday 18 June 2004 3:03:15 am

Mark,

Many thanks - this code works perfectly!

Regards, Steve.

http://www.oneworldmarket.co.uk

Søren Knudsen

Tuesday 08 February 2005 8:23:01 am

How should i do if i only want to have the selected menu-item class="selected" in the menu, and not the whole path down to this item?

Best regards,
Søren Knudsen

eZ debug

Timing: Jan 19 2025 20:11:26
Script start
Timing: Jan 19 2025 20:11:26
Module start 'content'
Timing: Jan 19 2025 20:11:27
Module end 'content'
Timing: Jan 19 2025 20:11:27
Script end

Main resources:

Total runtime1.3894 sec
Peak memory usage4,096.0000 KB
Database Queries205

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0089 589.1953180.8125
Module start 'content' 0.00891.2306 770.0078613.3594
Module end 'content' 1.23950.1498 1,383.3672341.0391
Script end 1.3893  1,724.4063 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00430.3107210.0002
Check MTime0.00140.1036210.0001
Mysql Total
Database connection0.00150.109910.0015
Mysqli_queries1.301093.63902050.0063
Looping result0.00210.15182030.0000
Template Total1.354397.520.6772
Template load0.00210.153520.0011
Template processing1.352297.321920.6761
Template load and register function0.00010.009810.0001
states
state_id_array0.00140.100210.0014
state_identifier_array0.00120.088620.0006
Override
Cache load0.00180.1306300.0001
Sytem overhead
Fetch class attribute can translate value0.00200.140940.0005
Fetch class attribute name0.00170.121370.0002
XML
Image XML parsing0.00080.059840.0002
class_abstraction
Instantiating content class attribute0.00000.001380.0000
General
dbfile0.00680.4885260.0003
String conversion0.00000.000430.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
6content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
8content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
2content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
2content/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: 21
 Number of unique templates used: 7

Time used to render debug report: 0.0002 secs