Empty treemenu on search result page

Author Message

Aleksander Lech

Tuesday 24 January 2006 5:53:35 am

Hello there,
I'm still having problem with menu generated by treemenu function:

{let docs=treemenu( $module_result.path,
                             is_set( $module_result.node_id )|choose( 2, $module_result.node_id ),
                             array( 1 ),0, 2 )}
{section var=menu loop=$docs}
    {section show=$menu.item.is_selected}
        <div class="level-{$menu.item.level}">
            <div class="selected">
            	<a href={$menu.item.url_alias|ezurl}>{$menu.item.text}</a>
            </div>  
        </div>
        {section-else}
        <div class="level-{$menu.item.level}">
            <a href={$menu.item.url_alias|ezurl}>{$menu.item.text}</a>
        </div>
        {/section}
{/section}
</ul>
{/let}

returns nothing on search result page, and works well everywhere else.

Any idea what's wrong?

Aleksander

André R.

Monday 13 February 2006 7:52:05 am

bacause sort is a system function, just like user/login.

$module_result.path and $module_result.node_id probably returns null / false

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom

Neidy Tunzine

Tuesday 14 February 2006 2:19:44 am

I had the same problem and i found a solution that works fine for me.
In the template witch calls the search result let's call it pagelayout_search.tpl add the code (in this case we are making the top menu work) :

{let home_path=array( hash('text','Home','url','/content/view/full/2','url_alias','','node_id','2'))}
    {menu name=TopMenu}
{/let}

and in the template with the tremenu function place with the code bellow:

{let docs=treemenu( $home_path, 2, array( 1 ),0, 2 )}
{section var=menu loop=$docs}
   {section show=$menu.item.is_selected}
       <div class="level-{$menu.item.level}">
           <div class="selected">
               <a href={$menu.item.url_alias|ezurl}>{$menu.item.text}</a>
           </div>  
       </div>
       {section-else}
       <div class="level-{$menu.item.level}">
           <a href={$menu.item.url_alias|ezurl}>{$menu.item.text}</a>
       </div>
       {/section}
{/section}
</ul>
{/let}

http://www.mzbusiness.com

Aleksander Lech

Tuesday 14 February 2006 3:28:43 am

Hi Neidy
looks like your solution worked for me :)

Big thanks for suggestion.

Aleksander

Aleksander Lech

Wednesday 15 February 2006 6:53:06 am

Unfortunately - I was to quick tellin' you that it works.

Menu appears on search result page - but it won't expand anymore.

I thought that

{let docs=treemenu( $home_path, 2, array( 1 ),0, 2 )}

means that menu should be build from node_id=2, folders, none ommited and depth=2
but only first level items are shown, and doesn't expand after click on it.
this code (from original flat_left.tpl)

{let docs=treemenu( $module_result.path,
                    is_set( $module_result.node_id )|choose( 2, $module_result.node_id ),
                    ezini( 'MenuContentSettings', 'LeftIdentifierList', 'menu.ini' ),
                    0, 5 )
                    depth=2
                    last_level=0}

expands good but disappears on search result.

Aleksander

Neidy Tunzine

Thursday 16 February 2006 1:46:52 am

The treemenu is better explained by the link bellow:

http://ez.no/doc/ez_publish/technical_manual/3_6/reference/template_operators/miscellaneous/treemenu

Have a nice day.

http://www.mzbusiness.com

Leif Arne Storset

Friday 23 June 2006 9:52:11 am

Although it won't help Lech, Tunzine's solution works fine if you are not using a dynamic (JavaScript) menu.

Leif Arne Storset

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 02:14:51
Script start
Timing: Jan 18 2025 02:14:51
Module start 'layout'
Timing: Jan 18 2025 02:14:51
Module start 'content'
Timing: Jan 18 2025 02:14:52
Module end 'content'
Timing: Jan 18 2025 02:14:52
Script end

Main resources:

Total runtime1.2884 sec
Peak memory usage4,096.0000 KB
Database Queries73

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0069 592.1328152.6406
Module start 'layout' 0.00700.0032 744.773439.4766
Module start 'content' 0.01021.2765 784.2500663.0859
Module end 'content' 1.28670.0017 1,447.335916.1406
Script end 1.2884  1,463.4766 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00320.2474160.0002
Check MTime0.00130.1039160.0001
Mysql Total
Database connection0.00110.087410.0011
Mysqli_queries1.220394.7149730.0167
Looping result0.00080.0603710.0000
Template Total1.251797.220.6259
Template load0.00230.179920.0012
Template processing1.249496.972320.6247
Template load and register function0.00020.017610.0002
states
state_id_array0.00130.102310.0013
state_identifier_array0.00170.131320.0008
Override
Cache load0.00190.1437420.0000
Sytem overhead
Fetch class attribute can translate value0.00090.070240.0002
Fetch class attribute name0.00240.190090.0003
XML
Image XML parsing0.00120.095040.0003
class_abstraction
Instantiating content class attribute0.00000.001490.0000
General
dbfile0.00350.2732230.0002
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
7content/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
11content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
5content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
2content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 31
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs