custom left menu

Author Message

Kevin Myles

Sunday 01 August 2004 10:29:34 am

I have created a custom left menu so it displays the subfolders of a particular node (109).
It looks great except when you select the a subfolder, subsubfolder, or an article of 109, when it displays everything fine, but also displays the subfolders of node 109 under the first subfolder like so:

sub a
-sub a
-sub b
-sub c
sub b
sub c
sub d

A moderator via email suggested I compare the current $menu.node_id against the currently displayed node ($DesignKeys:used.node) and its parent node ($DesignKeys:used.parent_node). (see below) But unfortunately, this hasn't worked.

below is the code. Please take some pity and help!
Thanks.


{let docs=treemenu( $module_result.path,
                    109,
                    array( 'folder' ), 1, 5 )
                    depth=1}
<b>::Issues of Concern::</b>         <ul>
     
        {section var=menu loop=$:docs last-value}
       {section show=ne( array( $DesignKeys:used.node, $DesignKeys:used.parent_node ),contains( 109 ) )}
            {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( 35 )}</a>

            {set depth=$menu.level}
        {/section}
           </li>

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

{/let}

Kevin Myles

Monday 02 August 2004 1:24:55 pm

I would appreciate some help as this is my last hurdle to going live.
Cheers,
Kevin.

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 19:23:26
Script start
Timing: Jan 18 2025 19:23:26
Module start 'layout'
Timing: Jan 18 2025 19:23:26
Module start 'content'
Timing: Jan 18 2025 19:23:27
Module end 'content'
Timing: Jan 18 2025 19:23:27
Script end

Main resources:

Total runtime1.3618 sec
Peak memory usage4,096.0000 KB
Database Queries52

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0059 588.9453152.6094
Module start 'layout' 0.00590.0056 741.554739.4141
Module start 'content' 0.01151.3490 780.9688431.4219
Module end 'content' 1.36050.0013 1,212.39068.1875
Script end 1.3618  1,220.5781 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00410.2992160.0003
Check MTime0.00140.0997160.0001
Mysql Total
Database connection0.00080.058710.0008
Mysqli_queries1.321097.0060520.0254
Looping result0.00040.0330500.0000
Template Total1.328897.620.6644
Template load0.00210.152220.0010
Template processing1.326797.423720.6634
Template load and register function0.00020.012410.0002
states
state_id_array0.00100.072610.0010
state_identifier_array0.00130.091920.0006
Override
Cache load0.00170.1263200.0001
Sytem overhead
Fetch class attribute can translate value0.00080.059610.0008
Fetch class attribute name0.00100.072420.0005
XML
Image XML parsing0.00020.011610.0002
class_abstraction
Instantiating content class attribute0.00000.000420.0000
General
dbfile0.00060.0405100.0001
String conversion0.00000.000840.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
4content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
4content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.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: 13
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs