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

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:31:11
Script start
Timing: Jan 18 2025 18:31:11
Module start 'layout'
Timing: Jan 18 2025 18:31:11
Module start 'content'
Timing: Jan 18 2025 18:31:13
Module end 'content'
Timing: Jan 18 2025 18:31:13
Script end

Main resources:

Total runtime1.8963 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.0051 587.9141152.6250
Module start 'layout' 0.00510.0032 740.539139.4609
Module start 'content' 0.00831.8864 780.0000572.7813
Module end 'content' 1.89470.0015 1,352.781316.1641
Script end 1.8962  1,368.9453 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00340.1768160.0002
Check MTime0.00150.0769160.0001
Mysql Total
Database connection0.00100.050910.0010
Mysqli_queries1.836696.8546630.0292
Looping result0.00070.0368610.0000
Template Total1.858298.020.9291
Template load0.00220.117120.0011
Template processing1.856097.874920.9280
Template load and register function0.00020.011210.0002
states
state_id_array0.00090.048010.0009
state_identifier_array0.00320.170620.0016
Override
Cache load0.00190.0990400.0000
Sytem overhead
Fetch class attribute can translate value0.00070.037720.0004
Fetch class attribute name0.00190.098460.0003
XML
Image XML parsing0.00070.035720.0003
class_abstraction
Instantiating content class attribute0.00000.001070.0000
General
dbfile0.00090.0496160.0001
String conversion0.00000.001340.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
4content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
12content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
7content/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: 32
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs