Forums / Setup & design / Has RootNode any effect ?

Has RootNode any effect ?

Author Message

Pascal France

Tuesday 23 May 2006 5:11:06 am

Hi,

I would like to define the root node ID from which the menu of the public site will show items.

I tried to change the RootNode setting in content.ini and content.ini.append.php but the root node is always 2. (Reading some old posts, it seems that I am not alone having this problem).

Is it the right way to do what I want and is there a way to define such a node ?

Pascal

Ce qui embellit le désert c'est qu'il cache un puits... quelque part... (A. de Saint-Exupéry) - http://luxpopuli.fr/eZ-Publish

Kristof Coomans

Tuesday 23 May 2006 11:03:17 pm

Hi Pascal

It is possible to use the rootNode setting, but you will have to modify some templates to use it.

The flat top menu uses a hardcoded value 2 in it's templates. If you replace this with something like

ezini('NodeSettings','RootNode','content.ini')

then you'll get what you want.

But you will probably need to change some other templates too.

independent eZ Publish developer and service provider | http://blog.coomanskristof.be | http://ezpedia.org

Pascal France

Wednesday 24 May 2006 1:12:20 am

Hi Kristof,

Thanks.

In design/base/templates/menu/double_top.tpl I:
* added this first line:

  1 {let id_node_root=ezini('NodeSettings','RootNode','content.ini')}

* changed:

  2 {let root_node=fetch( content, node, hash( node_id, 2 ) )}

to

  2 {let root_node=fetch( content, node, hash( node_id, $id_node_root ) )}

and

  8     {let menuitems=fetch( content, list, hash( parent_node_id, 2,

to

  8     {let menuitems=fetch( content, list, hash( parent_node_id, $id_node_root,

This works for the topmenu (first level) but submenu items are same than first level items (http://www.linuxorable.net/ez_test3.7.5/index.php/prive/)

Could you explain me how does work "var=xxx" in this line, for example:

 13     {section var=menu loop=$menuitems}

Another thing: in pagelayout.tpl, it seems that the top menu is included with:

 75     {menu name=TopMenu}

but I don't understand how it works.

Pascal

Ce qui embellit le désert c'est qu'il cache un puits... quelque part... (A. de Saint-Exupéry) - http://luxpopuli.fr/eZ-Publish

Pascal France

Wednesday 24 May 2006 2:35:18 am

To solve the problem, I have to set $module_result.path[1] to $module_result.path[2] in line 32 and 33

Now, I would like to use my new double_top.tpl only when users are logged in and use the section X
So, I did a pagelayout.tpl override:

  3 [pagelayout]
  4 Source=pagelayout.tpl
  5 MatchFile=my_pagelayout.tpl
  6 Subdir=templates
  7 Match[section]=X

But how can I define that my_pagelayout.tpl use "my_double_top.tpl" ?
I tried {include uri="design:my_double_top.tpl"} instead of {menu name=TopMenu} but of course, it doesn't work.

Pascal

Ce qui embellit le désert c'est qu'il cache un puits... quelque part... (A. de Saint-Exupéry) - http://luxpopuli.fr/eZ-Publish

Pascal France

Wednesday 24 May 2006 4:43:06 am

Hi,

I did a menu extension and now I can assign my "my_double_top" menu to my private siteaccess.

Pascal

Ce qui embellit le désert c'est qu'il cache un puits... quelque part... (A. de Saint-Exupéry) - http://luxpopuli.fr/eZ-Publish

Alexandre Cunha

Friday 21 July 2006 5:25:27 pm

Hi Pascal,

Your solution solves part of a problem I have.
Where I can find the extension you have writen ?

http://AlexandreCunha.com