Forums / Developer / Treemenus, fetching doesn't work??

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

eZ debug

Timing: Jan 18 2025 18:31:40
Script start
Timing: Jan 18 2025 18:31:40
Module start 'content'
Timing: Jan 18 2025 18:31:40
Module end 'content'
Timing: Jan 18 2025 18:31:41
Script end

Main resources:

Total runtime0.1822 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.0193 587.7109180.8359
Module start 'content' 0.01930.0055 768.546994.0078
Module end 'content' 0.02480.1573 862.5547522.8281
Script end 0.1821  1,385.3828 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00351.9298200.0002
Check MTime0.00140.7696200.0001
Mysql Total
Database connection0.00110.590210.0011
Mysqli_queries0.124668.42141410.0009
Looping result0.00140.77201390.0000
Template Total0.157086.210.1570
Template load0.00080.455610.0008
Template processing0.156185.713210.1561
Override
Cache load0.00060.330410.0006
Sytem overhead
Fetch class attribute can translate value0.00090.483610.0009
XML
Image XML parsing0.00030.152110.0003
General
dbfile0.00301.6221200.0001
String conversion0.00000.003030.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