Forums / Setup & design / Empty treemenu on search result page

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

eZ debug

Timing: Jan 18 2025 00:57:40
Script start
Timing: Jan 18 2025 00:57:40
Module start 'content'
Timing: Jan 18 2025 00:57:40
Module end 'content'
Timing: Jan 18 2025 00:57:40
Script end

Main resources:

Total runtime0.1875 sec
Peak memory usage2,048.0000 KB
Database Queries141

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0075 589.4297180.8281
Module start 'content' 0.00750.0074 770.2578102.0234
Module end 'content' 0.01490.1724 872.2813530.8281
Script end 0.1874  1,403.1094 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00361.8971200.0002
Check MTime0.00130.7070200.0001
Mysql Total
Database connection0.00120.623110.0012
Mysqli_queries0.134671.80371410.0010
Looping result0.00180.96571390.0000
Template Total0.171891.610.1718
Template load0.00090.464610.0009
Template processing0.170991.168310.1709
Override
Cache load0.00060.323810.0006
Sytem overhead
Fetch class attribute can translate value0.00080.436910.0008
XML
Image XML parsing0.00030.156310.0003
General
dbfile0.00522.7642200.0003
String conversion0.00000.003230.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
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs