Custom Left Menu--Fetch Subfolders of Specific Folders

Author Message

Kevin Myles

Thursday 08 July 2004 10:27:16 am

I want to have my left menu display the subfolders of a specific folders.

I made the following modification to the /menu/flat_left.tpl,

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

<h3 class="hide">{"Left menu"|i18n("design/base")}</h3>
<div class="unnamed1">
<form action={"/content/search/"|ezurl} method="get"> 
<table><table width="100%">
    <td height="16" td width="60"><b>{"Search UHRP.org"|i18n("design/standard/content/search")}</b>
            <input class="fullbox" type="text" size="9" name="SearchText2" id="SearchText" value="{$search_text|wash}" />
      <input class="button" name="SearchButton" type="submit" value="{'>'|i18n('design/standard/layout')}" />
      </div></td>
  </tr></table></class>
</div>
<br>

{let docs=treemenu( $module_result.path,
                    109,
                    array( 'folder' ), 0, 5 )
                    depth=1}
<b>::Issues of Concern::</b>         <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(50)}</a>

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

Alex Jones

Thursday 08 July 2004 10:52:43 am

Kevin, what is the problem that you need help with? IS this code not working? If not, what is/is not happening when you view the page?

Alex
bald_technologist on the IRC channel: #eZpublish
http://www.agrussell.com :: http://www.cuttingedge.com

Alex
[ bald_technologist on the IRC channel (irc.freenode.net): #eZpublish ]

<i>When in doubt, clear the cache.</i>

Kevin Myles

Thursday 08 July 2004 12:14:39 pm

weird, for some reason the rest of my post wasn't posted.

anyway, I want the left menu to show the subfolders of a specific folder with the node id of 109...so above is the code i used,

but instead, it displays the top/main folder (node 2), with node 109's sub tree.

Yet, if you run a search, the results page are what i want. This is very confusing. Any help would be appreciated.
Cheers!
Kevin.

Kevin Myles

Sunday 11 July 2004 4:11:22 pm

so a few days later and i'm still stuck. i should note that i modified the menu.ini file to add a menu option (left + double top) so I'm using the flat left menu instead of the sub_left menu. I've been trying to solve this for a while, even trying to integrate the code from the top menu, but it doesn't seem to work. any suggestions as to how to get this to work properly would be really appreciated.....

the original code is this:

 
{let docs=treemenu( $module_result.path,
                    $module_result.node_id,
                    array( 'folder' ), 0, 5 )
                    depth=1}

obviously replacing

$module_result.node_id

, is wrong....how do i change the value of the root folder?

thanks for help

Kevin Myles

Friday 16 July 2004 7:20:58 am

with some help from a moderator, i discovered that this is the proper code:

 {let docs=treemenu( $module_result.path,
                    109,
                    array( 'folder' ), 1, 5 )
                    depth=1} 

changing the '0' to a '1' between the array and the list number (5).

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 20 2025 00:26:52
Script start
Timing: Jan 20 2025 00:26:52
Module start 'layout'
Timing: Jan 20 2025 00:26:52
Module start 'content'
Timing: Jan 20 2025 00:26:52
Module end 'content'
Timing: Jan 20 2025 00:26:52
Script end

Main resources:

Total runtime0.5471 sec
Peak memory usage4,096.0000 KB
Database Queries63

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0066 589.3984152.6563
Module start 'layout' 0.00660.0032 742.054739.5078
Module start 'content' 0.00980.5359 781.5625562.5781
Module end 'content' 0.54580.0013 1,344.140616.1094
Script end 0.5471  1,360.2500 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00310.5588160.0002
Check MTime0.00130.2373160.0001
Mysql Total
Database connection0.00160.301410.0016
Mysqli_queries0.498091.0356630.0079
Looping result0.00040.0773610.0000
Template Total0.520695.220.2603
Template load0.00180.329920.0009
Template processing0.518794.820220.2594
Template load and register function0.00010.027410.0001
states
state_id_array0.00030.051710.0003
state_identifier_array0.00080.142720.0004
Override
Cache load0.00160.2838310.0001
Sytem overhead
Fetch class attribute can translate value0.00040.073920.0002
Fetch class attribute name0.00080.145960.0001
XML
Image XML parsing0.00060.102820.0003
class_abstraction
Instantiating content class attribute0.00000.001860.0000
General
dbfile0.00080.1427160.0000
String conversion0.00000.001740.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
5content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
10content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
4content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1content/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
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 24
 Number of unique templates used: 7

Time used to render debug report: 0.0002 secs