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.