treemenu doesn't show up

Author Message

Joyce Ouchida

Thursday 27 April 2006 2:50:21 pm

I have used the code sample under 'treemenu' in Documentation (http://ez.no/doc/ez_publish/technical_manual/3_6/reference/template_operators/miscellaneous/treemenu) in my pagelayout, but nothing is generated. I have changed the code to the minimum, as follows:

<ul>
{def $mainMenu = treemenu( $module_result.path, $module_result.node_id)}
{foreach $mainMenu as $menu}
    <li class="level_{$menu.level}">
        <a href={$menu.url_alias|ezurl}>{$menu.text}</a>
    </li>
{/foreach}
</ul>

and still nothing. Is this code supposed to retrieve all subtrees in the system? What am I doing wrong?

Thanks for any help.

Mads Ovesen

Friday 28 April 2006 3:03:33 am

The code looks right. For some reason your $mainMenu array is empty. Check $module_result.path og $module_result.node_id to see if they are set properly.

/M

/m

David Barber

Tuesday 09 May 2006 11:31:56 am

I had exactly the same problem, using the syntax provided in the Learning eZ publish 3 book. I went looking, and found this response on a French forum (if you don't read French, take a look at the code near the bottom)

http://ezpublish-france.fr/index.php/fr/forums/questions_techniques/menu_gauche_fonction_treemenu

It isn't exactly the same, in that it only generates a menu from whichever node you give it, but it's very clean code, which I appreciate. Of course, you can substitute 'tree' for 'list' to get everything below the current node.

David

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

Main resources:

Total runtime0.9148 sec
Peak memory usage4,096.0000 KB
Database Queries59

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0046 587.9141152.6250
Module start 'layout' 0.00460.0025 740.539139.4453
Module start 'content' 0.00710.9060 779.9844529.0313
Module end 'content' 0.91320.0016 1,309.01568.1641
Script end 0.9148  1,317.1797 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00320.3516160.0002
Check MTime0.00140.1499160.0001
Mysql Total
Database connection0.00060.063610.0006
Mysqli_queries0.874295.5579590.0148
Looping result0.00060.0688570.0000
Template Total0.884496.720.4422
Template load0.00190.206820.0009
Template processing0.882596.470020.4412
Template load and register function0.00010.014010.0001
states
state_id_array0.00100.110810.0010
state_identifier_array0.00100.112920.0005
Override
Cache load0.00160.1699150.0001
Sytem overhead
Fetch class attribute can translate value0.00080.083130.0003
Fetch class attribute name0.00140.153430.0005
XML
Image XML parsing0.00040.040130.0001
class_abstraction
Instantiating content class attribute0.00000.001030.0000
General
dbfile0.00060.0708100.0001
String conversion0.00000.000740.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
3content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.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: 10
 Number of unique templates used: 5

Time used to render debug report: 0.0001 secs