Share » Forums » Setup & design » Treemenu

Treemenu

Treemenu

Sunday 06 April 2003 3:52:51 am - 11 replies

Modified on Sunday 06 April 2003 3:55:05 am by Ekkehard Dörre

Author Message

Darius Loktevic

Monday 07 April 2003 1:08:21 am

Can ez make better docs? :(

Kai Duebbert

Monday 07 April 2003 1:27:57 am

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.

Post your improvements.

Kai

Jan Borsodi

Monday 07 April 2003 5:22:29 am

{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.

--
Amos

Documentation: http://ez.no/ez_publish/documentation
FAQ: http://ez.no/ez_publish/documentation/faq

Ekkehard Dörre

Monday 07 April 2003 6:08:04 am

Wonderfull,

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.

ekke

http://www.coolscreen.de - Over 40 years of certified eZ Publish know-how: http://www.cjw-network.com
CJW Newsletter: http://projects.ez.no/cjw_newsletter - http://cjw-network.com/en/ez-publ...w-newsletter-multi-channel-marketing

Kai Duebbert

Monday 07 April 2003 8:01:52 pm

Hi,

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.

I'm glad this works now because we need it too.

Kai

Kristjan Klementi

Tuesday 08 April 2003 12:08:20 am

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

Ekkehard Dörre

Tuesday 08 April 2003 2:59:59 am

@all: Thanks, it's great
@ Kristjan: I put it into the WIKI:
http://ezwiki.blanko.info/index.php/3XHT_NiceUrls

ekke

http://www.coolscreen.de - Over 40 years of certified eZ Publish know-how: http://www.cjw-network.com
CJW Newsletter: http://projects.ez.no/cjw_newsletter - http://cjw-network.com/en/ez-publ...w-newsletter-multi-channel-marketing

Kristjan Klementi

Tuesday 08 April 2003 4:18:36 am

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

Karsten Jennissen

Tuesday 08 April 2003 4:30:21 am

Maybe you find some help here:

http://ez.no/developer/ez_publish_3/forum/setup_design/nice_urls

Karsten

Kai Duebbert

Tuesday 08 April 2003 7:37:13 pm

Hi,

I fixed the "no module" problem. See if you still have problems: http://ezwiki.blanko.info/index.php/3XHT_TmplObjTree

Kai

Kristjan Klementi

Wednesday 09 April 2003 5:06:52 am

Just about getting better and better.
That 'no module problem' is gone for me now.
Great . thanks for help.
/ Kristjan

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu