Forums / Setup & design / display one folder in left menu

display one folder in left menu

Author Message

Rafał F

Wednesday 08 August 2007 7:00:01 am

Hello
I would like to show concrete folder(and children) in left menu but how?
I have currently code

{let docs=treemenu( $module_result.path,

                    is_set( $module_result.node_id )|choose( 2, $module_result.node_id ),

                    ezini( 'MenuContentSettings', 'LeftIdentifierList', 'menu.ini' ),

                    0, 1 )

                    depth=1

                    last_level=0}

        <ul>

        {section var=menu loop=$:docs last-value}

            {set last_level=$menu.last|is_array|choose( $menu.level, $menu.last.level )}

            {section show=and( $last_level|eq( $menu.level ), $menu.number|gt( 1 ) )}

                </li>

            {section-else}

            {section show=and( $last_level|gt( $menu.level ), $menu.number|gt( 1 ) )}

                </li>

                    {"</ul>

                </li>"|repeat(sub( $last_level, $menu.level ))}

            {/section}

            {/section}



            {section show=and( $last_level|lt( $menu.level ), $menu.number|gt( 1 ) )}

                {'<ul><li>'|repeat(sub($menu.level,$last_level,1))}

                <ul>

                    <li class="menu-level-{$menu.level}">

            {section-else}

                <li class="menu-level-{$menu.level}">

            {/section}



            {if $menu.is_selected}

            	<span class="selected">{$menu.text|shorten( 25 )}</span>

            {else}

            	<a href={$menu.url_alias|ezurl}>{$menu.text|shorten( 25 )}</a>

            {/if}



            {set depth=$menu.level}

        {/section}

           </li>



        {section show=sub( $depth, 0 )|gt( 0 ) loop=sub( $depth, 0 )}

            </ul>

        </li>

        {/section}

        </ul>



{/let}

How change this script?
Please help and very thanks for reply :)

Felix Laate

Wednesday 08 August 2007 12:36:27 pm

Hi there,

at the top of your code, there is this:

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

you can easily change the folder by changing

is_set( $module_result.node_id )|choose( 2, $module_result.node_id )

to the node id of the folder you want. Simply replace this content with a number (the node id).

For more info, have a look here: http://ez.no/doc/ez_publish/technical_manual/3_9/reference/template_operators/miscellaneous/treemenu

Felix

Publlic Relations Manager
Greater Stavanger
www.greaterstavanger.com

Rafał F

Thursday 09 August 2007 2:18:09 am

thanks but i can't ;)
i change on

{let docs=treemenu(  $module_result.path,
                                     $module_result.node_id,
                                    array('59'), 0, 4 ),
                    ezini( 'MenuContentSettings', 'LeftIdentifierList', 'menu.ini' ),
                    0, 2 )
                    depth=1
                    last_level=0}

59- id folder article but don't display article folder and there childrens
why? :(

{let docs=treemenu(  $module_result.path,
                                    is_set( $module_result.node_id,
                                    array('59'), 0, 4 )),
                    ezini( 'MenuContentSettings', 'LeftIdentifierList', 'menu.ini' ),
                    0, 2 )
                    depth=1
                    last_level=0}

display all folders :(

Felix please help me ;)

Felix Laate

Saturday 11 August 2007 3:32:49 pm

Hi Rafal,

seems I was a bit quick there. Changing the node alone wont do the trick. Read this:

http://ez.no/community/forum/developer/menu_placed_outside_pagelayout_tpl/re_menu_placed_outside_pagelayout_tpl__3

Felix

Publlic Relations Manager
Greater Stavanger
www.greaterstavanger.com

Rafał F

Monday 13 August 2007 8:53:55 am

i have

{def $module_path=array()}
{def $list_items=fetch( 'content','list', hash( 'parent_node_id',59,'offset',0,'class_filter_type', 'include','class_filter_array',array('folder'),'sort_by',array( 'name', true()) ) )}
{foreach $list_items as $item}
<div>{$item.object.data_map.name.content|wash}</div>
{/foreach}
     {undef $module_path $list_items}

{let docs=treemenu($module_path,(...))

but display on web

{foreach $list_items as $item}
<div>{$item.object.data_map.name.content|wash}</div>
{/foreach}

I would like to display function list_items in $treemenu

eZ debug

Timing: Jan 20 2025 04:08:20
Script start
Timing: Jan 20 2025 04:08:20
Module start 'content'
Timing: Jan 20 2025 04:08:20
Module end 'content'
Timing: Jan 20 2025 04:08:20
Script end

Main resources:

Total runtime0.0219 sec
Peak memory usage2,048.0000 KB
Database Queries4

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0066 588.9766180.8359
Module start 'content' 0.00660.0069 769.8125101.9922
Module end 'content' 0.01340.0084 871.804778.7031
Script end 0.0219  950.5078 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00188.1716120.0001
Check MTime0.00093.9134120.0001
Mysql Total
Database connection0.00125.251310.0012
Mysqli_queries0.002411.008340.0006
Looping result0.00000.063120.0000
Template Total0.008036.710.0080
Template load0.00104.378910.0010
Template processing0.007132.317810.0071
Override
Cache load0.00052.194910.0005
General
dbfile0.003817.4755100.0004
String conversion0.00000.022830.0000
Note: percentages do not add up to 100% because some accumulators overlap

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