Ok, I made a first rough solution. Have a look at the new page: http://ezwiki.blanko.info/index.php/3XHT_TmplObjTree
It's rough, so if anyone has improvements, please contribute! I just couldn't get the "contains" function to work as a show parameter for section. That would simplify it.
Also, it accomodates for three levels so far, but extending it (read: repeating some code) is trivial.
{let current_node=fetch(content,node,hash(node_id,$DesignKeys:used.node))}
... loop trough menu {section show=$current_node.path_array|contains($Folder:item.node_id)}
Expand item...
{/section}
... {/let}
path_array returns the path of the node as an array of node IDs.
There's also the treemenu template operator which was shipped with 3.0, it is not general but can used as basis for your own menu operator. See kernel/commom/eztreemenuoperator.php for the code.
Updated: Made sure the node was fetched before using it.
on http://ezwiki.blanko.info/index.php/3XHT_TmplObjTree
I wrote: Same as "A first solution" but extended with 4 Levels, with marking active menue and Links added.
Big THANKS to Kai Duebbert
Oh while I'm working a new Post came in, I'll try it.
Thanks Jan and Ekke. I rewrote the whole tree menu page so it combines all suggestions. The code is much tighter now. BTW Jan, $DesignKeys:used.node hands back the node_id, not a node object. So it doesn't have a path_array. (At least that's how it is in v3.0.)
Have a look at http://ezwiki.blanko.info/index.php/3XHT_TmplObjTree again. I also extended the marking of the active menu so that it also marks the parent menus a bit. Now this page should explain better how to create a tree menu.
Thanks a lot I personally find it very difficult to make the templates.... Never done them before So any template structure that can be copied is always welcome to me.
As I like the "Nice URL's" that this template did not produce I just changed the href tag with
href={$:item.url_alias|ezurl}>
Just great. I just learned that trick now, and maybe thats usefull also to somebody else Cheers / Kristjan
I played around today in my site I am making and I managed to get to an error "module not found".
With this the nice meny was all messed around dispaying everything possible to display. Got the same result with empty search.
So My thougt is that maybe it needs another "IF Then Else" function implemented inside of that. And I also thought that maybe some nice guys can think it out, if I mention that ? / Kristjan