Left menu with dynamic root node

Author Message

Nicolò Zanetti

Tuesday 04 December 2007 1:32:42 am

Hi,
I have a standard flat left menu (ezwebin extension, 3.10).
I noticed that the root node of this menu is set by the variable $pagerootdepth that is in the pagelayout.tpl.
I would like to override this variable in the flat_left.tpl, to obtain the current node as root of the menu. (menu will display sons of current node).
In the first row of flat_left.tpl i will add $pagerootdepth=???.

Thanks in advance, Nicolò

Salvatore Guarino

Tuesday 04 December 2007 2:18:47 am

Try to add this line:

{set $pagerootdepth = $module_result.content_info.node_depth|sum(-1)}

Nicolò Zanetti

Tuesday 04 December 2007 3:01:34 am

Well it works fine, it's exactly what i need... but it generates a bug in the menu title :( .
Actually, without the script the menu title when clicked redirect to the page that give the name to the menu title, with the script it redirect you to the home page.
I must find a way to correct this.

Nicolò Zanetti

Tuesday 04 December 2007 5:15:21 am

I just deleted the link part of the menu title script, and the menu title is correct even if unlinked, anyway it would have redirected to the same page, so it was a totally useless link.
Ty

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.