Treemenus, fetching doesn't work??

Author Message

Clemens T

Tuesday 31 May 2005 2:29:59 am

Heya all,
I'm currently trying to list a Folder structure with all subfolders, But i want it to look like this:

My First Folder
   My First SubFolder
My Second Folder
   My Second SubFolder
      My Third SubFolder

now, I've been checking some references, and it seems that for such a tree I have to use something like this:

{let nodes=fetch( 'content', 'tree', hash( 'parent_node_id', 42 ) ) }

{section loop=$nodes}
{$:item.name}<br />
{/section}

Only, how can I make sure there is extra spacing (like in my example provided), in front of the text of the subfolders?

Thanks for the effort of replying!
Greets,
Clemens

Ɓukasz Serwatka

Tuesday 31 May 2005 2:35:30 am

Hi Clemens,

This example will be usefull for you
http://ez.no/ez_publish/documentation/customization/tips_tricks/creating_tree_menus

Personal website -> http://serwatka.net
Blog (about eZ Publish) -> http://serwatka.net/blog

Clemens T

Tuesday 31 May 2005 3:20:02 am

Hey Lukasz,
Thanks for the quick reply!
I already tried something with loops (using $:item.depth etc... and then printing spaces etc).

Ok, now I have a followup question, because the article you provided has a comment with a link to the fetch treemenu functionality.

The link is: http://ez.no/ez_publish/documentation/reference/template_operators/miscellaneous/treemenu

(I'm currently running eZPublish 3.5.1 with a custom module I'm building right now)

When I try to use the treemenu fetch I can't get it to work. Here's some code:

<!-- this is my partial code for using the original tree fetch, for reference (works excellent)-->
...
{let folders=fetch( content, tree, hash( parent_node_id, $nodeid,
                                     sort_by, $node.sort_array,
                                     class_filter_type, include,
                                     class_filter_array, array( 'folder') ) )}
...

Now, when I do the following with treemenu fetch, I'd say it has to work, but it doesnt:

{let mainMenu=treemenu( $module_result.path,
$nodeid)}

{section var=menu loop=$mainMenu}
		<a href={$menu.item.url_alias|ezurl}>{$menu.item.text}</a><br />

{/section}

By the way, when I do this:
{$module_result.path} it doesn't print anything, would you know why?

Hopefully someone can help me on this!
Greets,
Clemens

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

Main resources:

Total runtime1.2945 sec
Peak memory usage4,096.0000 KB
Database Queries57

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0060 589.0469152.6250
Module start 'layout' 0.00600.0059 741.671939.4453
Module start 'content' 0.01181.2812 781.1172546.3516
Module end 'content' 1.29300.0014 1,327.468812.1563
Script end 1.2944  1,339.6250 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00370.2856160.0002
Check MTime0.00150.1189160.0001
Mysql Total
Database connection0.00080.058910.0008
Mysqli_queries1.235195.4094570.0217
Looping result0.00060.0463550.0000
Template Total1.230495.020.6152
Template load0.00220.172420.0011
Template processing1.228294.876320.6141
Template load and register function0.00020.017110.0002
states
state_id_array0.00600.465710.0060
state_identifier_array0.00270.209320.0014
Override
Cache load0.00180.1394330.0001
Sytem overhead
Fetch class attribute can translate value0.00070.053420.0003
Fetch class attribute name0.00130.098340.0003
XML
Image XML parsing0.00050.041320.0003
class_abstraction
Instantiating content class attribute0.00000.000640.0000
General
dbfile0.00090.0688180.0000
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
6content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
10content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
4content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1content/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: 26
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs